Ask Your Question
1

Heat cannot validate glance.image constraint

asked 2017-02-01 07:11:32 -0500

pasasap gravatar image

updated 2017-04-21 10:52:54 -0500

zaneb gravatar image

Hi. I have installed in one node openstack with packstack, I have changed only passwords and IPs, so I didn't have Heat. Then I have installed Heat using that install guide but for v2 api, so I ommited domain values, etc. I think it should work.

Now I try to deploy VM with Heat, but I get an error that I can't found fix for that error.

That is piece of my template file my_stack.yaml

parameters:
  flavor:
    type: string
    description: Flavor for the instances to be created.
    default: m1.tiny
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a flavor known to Nova.
  image:
    type: string
    description: Name or ID of the image to user for the instances.
    default: cirros
    constraints:
      - custom_constraint: glance.image
        description: Must identify an image known to Glance.
resources:
  server:
    type: OS::Nova::Server
    properties:
      flavor: { get_param: flavor }
      image: { get_param: image }

After calling:

openstack stack create -t ./my_stack.yaml my_stack

I get an error:

ERROR: Property error: : resources.server.properties.image: : "cirros" does not validate glance.image (constraint not found)

If I comment constraints for image, then in server resource i get the same error.

I have tried with image ID, with other images, I can't find solution for that. I didn't edit heat.conf file. I am using admin credentials. I gave here also flavor for nova, because Heat sees that properly. I am using v2 API for login (OS_AUTH_URL=.../v2.0).

Here some output:

# heat-api --version
7.0.1
# heat-api-cfn --version
7.0.1
# heat-engine --version
7.0.1
# heat --version
1.5.0
# glance-api --version
13.0.0
# glance-registry --version
13.0.0
# glance --version
2.6.0
# glance image-show 04c8bc65-7d00-4af9-bb1a-e74c44382685
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | ee1eca47dc88f4879d8a229cc70a07c6     |
| container_format | bare                                 |
| created_at       | 2016-11-25T00:23:15Z                 |
| disk_format      | raw                                  |
| id               | 04c8bc65-7d00-4af9-bb1a-e74c44382685 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros                               |
| owner            | 767bcfa93f374177bd3290ce08d90afd     |
| protected        | False                                |
| size             | 13287936                             |
| status           | active                               |
| tags             | []                                   |
| updated_at       | 2017-01-28T01:28:11Z                 |
| virtual_size     | None                                 |
| visibility       | public                               |
+------------------+--------------------------------------+
edit retag flag offensive close merge delete

Comments

I would configure debug logging and check the Heat log. It should tell you how Heat communicates with Glance.

Bernd Bausch gravatar imageBernd Bausch ( 2017-02-01 09:42:06 -0500 )edit

http://paste.openstack.org/show/597215/ (LINK) there is launched with debug and verbose flags.

pasasap gravatar imagepasasap ( 2017-02-01 09:44:41 -0500 )edit

This is the debug output of the openstack client, which doesn't help in this case. My suggestion is to ensure that Heat's log level is DEBUG, then check the Heat log file.

Bernd Bausch gravatar imageBernd Bausch ( 2017-02-01 16:16:22 -0500 )edit

Nevermind. I have installed from the beggining openstack with packstack witch Heat enabled. Thank You anyway ;')

pasasap gravatar imagepasasap ( 2017-02-02 05:52:23 -0500 )edit

please check your heat-engine.log check if you have the following ERROR likes:

ERROR stevedore.extension [-] Could not load 'glance': No module named openstack.common.apiclient ERROR stevedore.extension [-] Could not load 'glance.image': No module named openstack.c

downgrade glance client to fix

zioproto gravatar imagezioproto ( 2017-04-21 10:28:11 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-02-01 09:34:43 -0500

shasha.tavil gravatar image

Hey,

There may be a possibility of multiple images by name "cirros" in which case you need to give "ID" of the image instead of the name. Can you please check using "openstack image list"

edit flag offensive delete link more

Comments

No, there is only one image with cirros name. Image ID instead of the name didn't help.

pasasap gravatar imagepasasap ( 2017-02-01 09:41:36 -0500 )edit
0

answered 2017-02-01 22:28:04 -0500

zaneb gravatar image

updated 2017-04-21 10:57:10 -0500

I think the error message is a bit misleading here. It looks like the "(constraint not found)" means that Heat doesn't have the glance.image constraint installed at all. (It shouldn't imply there's a problem with the value... it can't even check the value.)

Constraints are registered in the setup.cfg file and that configuration data is written into the package's entry_points.txt file (in the egg-info directory) at installation time. Check the heat-engine log at startup to see if there are any errors.

Most likely this was due to having a glanceclient version that is too new. A change in glanceclient 2.6.0 made it incompatible with Newton and earlier Heat releases of Heat. If you're running Newton or earlier, you want to use an earlier version of glanceclient. Ocata and later versions of Heat contain a patch to use glanceclient 2.6.0 or later.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2017-02-01 07:11:32 -0500

Seen: 1,065 times

Last updated: Apr 21 '17