【问题标题】:"The Resource Type could not be found." while using template composition“找不到资源类型。”在使用模板组合时
【发布时间】:2018-04-03 13:02:07
【问题描述】:

我正在尝试将 template composition 与 OpenStack Heat 一起使用。

我创建了一个极简模板my-custom-resource.yml

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

此模板与我的环境文件environment.yml 中的名称My::Custom::Resource 相关联:

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

我在测试模板中使用它stack.yml

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

最后,我从命令行创建堆栈:

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

我收到以下错误:

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

我检查了每个文件名和路径,一切看起来都不错。

【问题讨论】:

    标签: openstack openstack-heat


    【解决方案1】:

    事实上,the documentation 说:

    模板文件扩展名必须为.yaml.template,否则不会 被视为自定义模板资源。

    因此,可以说这是所期望的行为...

    我真的不明白为什么存在这个限制以及为什么不支持.yml 扩展。

    此外,错误信息可能更明确!

    【讨论】:

      猜你喜欢
      • 2013-03-17
      • 1970-01-01
      • 2016-09-23
      • 2019-10-28
      • 2022-01-18
      • 1970-01-01
      • 2011-10-20
      • 2014-09-15
      • 1970-01-01
      相关资源
      最近更新 更多