Translate TOSCA description of instance capabilities to heat flavor

Registered by Victor HU

TOSCA template describe a server's capabilities by properties like disk_size, num_cpus, etc.. But hot template use a single flavor property. To cover this gap there're two options:
1. create a custom flavor by TOSCA description and use it while translating (but it requires admin role and there're lots of arguments of this topic)
2. query flavors from nova and pick the round one to translate.(Currently I noticed that if there is not a exact match, translator returns null. But it's not a precise translation, the sematics doesn't keep unchanged. )
Source the Openstack User credentials and use nova ReST API to fetch the flavor details and validate against the instance details

Blueprint information

Status:
Complete
Approver:
None
Priority:
High
Drafter:
Victor HU
Direction:
Approved
Assignee:
bharaththiruveedula
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
bharaththiruveedula
Completed by
bharaththiruveedula

Related branches

Sprints

Whiteboard

(spzala) https://blueprints.launchpad.net/heat/+spec/constraint-based-flavors-and-images for reference.
https://blueprints.launchpad.net/glance/+spec/enforce-image-properties
https://blueprints.launchpad.net/heat-translator/+spec/abstract-image-flavor-query

(spzala): Instead of using nova-client, I think we should use Nova REST APIs.

(spzala) We should not 'create' any new flavor. We only wants to query and find available best match flavor.

Gerrit topic: https://review.openstack.org/#q,topic:bp/match-custom-flavor,n,z

Addressed by: https://review.openstack.org/252834
    Add support to fetch flavor details from nova

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.