Using a Nova::Flavor resource in a Nova::Server resource fails validation

Bug #1556317 reported by Ben Nemec
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Rabi Mishra

Bug Description

When trying to use a flavor created by the template with the OS::Nova::Flavor resource type, validation of the stack fails because it looks for the flavor before it has been created (or so it appears to me). In a template containing the flavor and server resources shown below, creating a stack results in the following trace from heat-engine:

2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack [req-74e749c8-85b3-44c3-8c2c-f51f890f7be8 - admin - default default] Exception: (NotFound(),)
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack Traceback (most recent call last):
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack File "/usr/lib/python2.7/site-packages/heat/engine/stack.py", line 734, in validate
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack result = res.validate()
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack File "/usr/lib/python2.7/site-packages/heat/engine/resources/openstack/nova/server.py", line 1317, in validate
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack flavor_obj = self.client_plugin().get_flavor(flavor)
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack File "/usr/lib/python2.7/site-packages/heat/engine/clients/os/nova.py", line 254, in get_flavor
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack flavor = self.client().flavors.find(name=flavor_identifier)
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 400, in find
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack raise exceptions.NotFound(404, msg)
2016-03-11 23:35:42.378 19467 ERROR heat.engine.stack NotFound: No Flavor matching {'name': u'test_flavor'}. (HTTP 404)

The relevant bits from the template are:

  test_flavor:
    type: OS::Nova::Flavor
    properties:
      disk: 10
      ram: 512
      vcpus: 1

  server1:
    type: OS::Nova::Server
    depends_on: test_flavor
    properties:
      name: Server1
      image: { get_param: image }
      flavor: { get_resource: test_flavor }
      key_name: { get_param: key_name }
      networks:
        - port: { get_resource: server1_port }

Revision history for this message
Rabi Mishra (rabi) wrote :

I think this is a result of https://github.com/openstack/heat/commit/eeb52c5c4cc03650375586d6b08c33e13d47ee56 change, where the image,flavor combination is validated for the server.

If the flavor/image is not already created in nova, this would fail in validation.

Changed in heat:
assignee: nobody → Rabi Mishra (rabi)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/291971

Changed in heat:
status: New → In Progress
Changed in heat:
milestone: none → mitaka-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/291971
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=eb56cbc8a19c140ca51a6058027b8ab47a8650f7
Submitter: Jenkins
Branch: master

commit eb56cbc8a19c140ca51a6058027b8ab47a8650f7
Author: Rabi Mishra <email address hidden>
Date: Sat Mar 12 06:59:43 2016 +0530

    Ignore image and flavor validations

    Ignore image and flavor validations, if they are not yet
    created. This would happen in cases where user with
    sufficient privileges have them in the same template
    with server.

    Change-Id: I3450e85ee85fd40d96bc7d0506db6a2417ffec09
    Closes-Bug: #1556317

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0rc1

This issue was fixed in the openstack/heat 6.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.