openstackopenstack-heat

"The Resource Type could not be found." while using template composition


I'm trying to use template composition with OpenStack Heat.

I've created a minimalist template my-custom-resource.yml:

heat_template_version: 2016-04-08
description: My Custom Resource
resources:
  dummy:
    type: OS::Heat::None

This template is associated with the name My::Custom::Resource in my environment file environment.yml:

resource_registry:
  My::Custom::Resource: my-custom-resource.yml

I use it in a test template stack.yml:

heat_template_version: 2016-04-08
description: My Stack
resources:
  test:
    type: My::Custom::Resource

Finally, I create the stack from the command line:

openstack stack create -t stack.yml -e environment.yml my-stack

And I get the following error:

ERROR: The Resource Type (My::Custom::Resource) could not be found.

I checked every filenames and pathes, everything looks good.


Solution

  • In fact, the documentation says:

    The template file extension must be .yaml or .template, or it will not be treated as a custom template resource.

    Hence, one could say that this is the desired behavior...

    I don't really understand why this limitation exists and why .yml extension isn't supported as well.

    Furthermore, the error message could be more explicit!