Bug 1399653

Summary: OS_COMPUTE_API_VERSION not set in overcloudrc
Product: Red Hat OpenStack Reporter: Artom Lifshitz <alifshit>
Component: openstack-tripleoAssignee: James Slagle <jslagle>
Status: CLOSED NOTABUG QA Contact: Arik Chernetsky <achernet>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: gcharot, mburns, rhel-osp-director-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-26 16:33:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1399332    
Bug Blocks:    

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}}