Bug 1399653 - OS_COMPUTE_API_VERSION not set in overcloudrc
Summary: OS_COMPUTE_API_VERSION not set in overcloudrc
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: James Slagle
QA Contact: Arik Chernetsky
URL:
Whiteboard:
Depends On: 1399332
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-29 14:01 UTC by Artom Lifshitz
Modified: 2017-01-26 16:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-26 16:33:56 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Artom Lifshitz 2016-11-29 14:01:23 UTC
Description of problem:

The environment variable OS_COMPUTE_API_VERSION is not set in overcloudrc.

Openstackclient defaults to compute microversion 2, thus disabling microversions (which were introduced starting with 2.1) and everything good that comes with them, for example device role tagging that was introduced in 2.32. This can be worked around by either setting OS_COMPUTE_API_VERSION manually or giving --os-compute-api-version on the command line, but it's probably better to have defaults that allow users to use nifty new Nova features out of the box.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

To use the device tagging example, boot a VM with a nic tag:

$ openstack server create  --flavor m1.tiny --image cirros-0.3.4-x86_64 --key-name stack --security-group default --nic net-id=059a48f5-fc8e-4721-b694-f2441cf5226f,tag=bla test

Actual results:

Setting interface tags is unsupported before microversion 2.32

Expected results:

The VM boots.

Additional info:

There's a bug [1] in openstackclient which prevents us from just setting OS_COMPUTE_API_VERSION to 2.latest, which would be the best solution.

[1] https://bugs.launchpad.net/nova/+bug/1630161/

Comment 1 Artom Lifshitz 2017-01-26 16:33:56 UTC
The bug report is wrong. While the behaviour is indeed happening, the root cause is not a wrong/missing OS_COMPUTE_API_VERSION in overcloudrc. Rather, bz 1416565 is the cause. The correct microversion headers are being sent by the client, but the latest microversion in OSP10, 2.37, does not support device tagging because of a bug upstream. Here's a snippet of a boot request with a nic tag with debug enabled:

[stack@nova-477-1485444940-tempest--undercloud ~]$ nova --debug boot --flavor m1.nano --image cirros-0.3.4-x86_64-disk.img --nic net-id=c34a44f5-f55a-4317-a865-6b9f934064b,tag=foo test

DEBUG (session:337) REQ: curl -g -i -X POST http://192.0.2.14:8774/v2.1/servers -H "Accept: application/json" -H "User-Agent: python-novaclient" -H "OpenStack-API-Version: compute 2.37" -H "X-OpenStack-Nova-API-Version: 2.37" -H "X-Auth-Token: {SHA1}2ac4c27eba04d80953a6ff0d41968352f5129e9c" -H "Content-Type: application/json" -d '{"server": {"name": "test", "imageRef": "3cc2e137-dda0-44e7-aa7c-e71d895fc9cf", "flavorRef": "3f5090a9-cd71-46c6-9c3a-ae21b34e69d4", "max_count": 1, "min_count": 1, "networks": [{"tag": "foo", "uuid": "c34a44f5-f55a-4317-a865-6b9f934064b"}]}}'

DEBUG (session:366) RESP: [400] Openstack-Api-Version: compute 2.37 X-Openstack-Nova-Api-Version: 2.37 Vary: OpenStack-API-Version, X-OpenStack-Nova-API-Version Content-Type: application/json; charset=UTF-8 Content-Length: 275 X-Compute-Request-Id: req-f0f4f162-8604-4ef0-a02a-9df8843f8617 Date: Thu, 26 Jan 2017 16:28:17 GMT 
RESP BODY: {"badRequest": {"message": "Invalid input for field/attribute networks. Value: [{u'tag': u'foo', u'uuid': u'c34a44f5-f55a-4317-a865-6b9f934064b'}]. [{u'tag': u'foo', u'uuid': u'c34a44f5-f55a-4317-a865-6b9f934064b'}] is not valid under any of the given schemas", "code": 400}}


Note You need to log in before you can comment on or make changes to this bug.