我正在尝试使用 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.
我检查了每个文件名和路径,一切看起来都很好。
最佳答案
事实上,the documentation说:
The template file extension must be
.yaml
or.template
, or it will not be treated as a custom template resource.
因此,人们可以说这是期望的行为......
我不太明白为什么存在此限制以及为什么不支持 .yml
扩展。
此外,错误消息可以更明确!
关于openstack - "The Resource Type could not be found."使用模板合成时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49630794/