Heat模板全称为heat orchestration template,简称为HOT。

典型Heat模板结构

heat_template_version: 2015-04-30
description:
# a description of the template
parameter_groups:
# a declaration of input parameter groups and order
parameters:
# declaration of input parameters
resources:
# declaration of template resources
outputs:
# declaration of output parameters

2 heat_template_version

每个HOT需要包含 heat_template_version 字段,指明所使用的 HOT 版本。

每个版本支持的内置方法不同,比如2016-04-08版本支持的内置方法如下:

digest、 get_attr、get_file、get_param、get_resource、list_join、

map_merge、repeat、resource_façade、str_replace、str_split

3 parameter groups

用于指定参数的顺序,每个参数只能与指定的group关联一次。

parameter_groups:
- label: <human-readable label of parameter group>
description: <description of the parameter group>
parameters:
- <param name>
- <param name>

4 parameter

parameters:
<param name>:
type: <string | number | json | comma_delimited_list | boolean>
label: <human-readable name of the parameter>
description: <description of the parameter>
default: <default value for parameter>
hidden: <true | false>
constraints:
<parameter constraints>
immutable: <true | false>

示例:

parameters:
user_name:
type: string
label: User Name
description: User name to be configured for the application
port_number:
type: number
label: Port Number
description: Port number to be configured for the web server

parameter type:

Type

Description

Examples

string

A literal string.

“String param”

number

An integer or float.

“2”; “0.2”

comma_delimited_list

An array of literal strings that are separated by commas. The total number of strings should be one more than the total number of commas.

[“one”, “two”]; “one, two”; Note: “one, two” returns [“one”, ” two”]

json

A JSON-formatted map or list.

{“key”: “value”}

boolean

Boolean type value, which can be equal “t”, “true”, “on”, “y”, “yes”, or “1” for true value and “f”, “false”, “off”, “n”, “no”, or “0” for false value.

“on”; “n”

hidden:隐藏用户输入的信息,如密码,将 hidden 属性置为 true。

constraints已有的内置参数:OS::stack_name、OS::stack_id、OS::project_id。

constraints:
- <constraint type>: <constraint definition>
description: <constraint description>

5 resources

resources:
<resource ID>:
type: <resource type>
properties:
<property name>: <property value>
metadata:
<resource specific metadata>
depends_on: <resource ID or list of ID>
update_policy: <update policy>
deletion_policy: <deletion policy>

示例:

  resources:
my_instance:
type: OS::Nova::Server
properties:
flavor: m1.small
image: F18-x86_64-cfntools

资源依赖的示例:

resources:
server1:
type: OS::Nova::Server
depends_on: [ server2, server3 ] server2:
type: OS::Nova::Server

6 outputs

outputs:
<parameter name>:
description: <description>
value: <parameter value> 

示例:

outputs:
instance_ip:
description: IP address of the deployed compute instance
value: { get_attr: [my_instance, first_address] } 

编者注:本文来自OpenStack开源团队工程师陈曾

OpenStack Heat模板详解的更多相关文章

  1. OpenStack的Heat组件详解

    一:简介     一.什么Heat 1. Heat 是一套业务流程平台,旨在帮助用户更轻松地配置以 OpenStack 为基础的云体系.利用Heat应用程序,开发人员能够在程序中使用模板以实现资源的自 ...

  2. OpenStack各组件详解和通信流程

    一.openstack由来 openstack最早由美国国家航空航天局NASA研发的Nova和Rackspace研发的swift组成.后来以apache许可证授权,旨在为公共及私有云平台建设.open ...

  3. C++模板详解

    参考:C++ 模板详解(一) 模板:对类型进行参数化的工具:通常有两种形式: 函数模板:仅参数类型不同: 类模板:   仅数据成员和成员函数类型不同. 目的:让程序员编写与类型无关的代码. 注意:模板 ...

  4. OpenStack Paste.ini详解(二)

    接着OpenStack Paste.ini详解(一),接下来就分析request被paste.ini处理的流程 WSGI server接收到URL形式的request时,这些request首先会被Pa ...

  5. 25.C++- 泛型编程之函数模板(详解)

    本章学习: 1)初探函数模板 2)深入理解函数模板 3)多参函数模板 4)重载函数和函数模板 当我们想写个Swap()交换函数时,通常这样写: void Swap(int& a, int&am ...

  6. 26.C++- 泛型编程之类模板(详解)

    在上章25.C++- 泛型编程之函数模板(详解) 学习了后,本章继续来学习类模板   类模板介绍 和函数模板一样,将泛型思想应用于类. 编译器对类模板处理方式和函数模板相同,都是进行2次编译 类模板通 ...

  7. Centos7上部署openstack ocata配置详解

    之前写过一篇<openstack mitaka 配置详解>然而最近使用发现阿里不再提供m版本的源,所以最近又开始学习ocata版本,并进行总结,写下如下文档 OpenStack ocata ...

  8. (转)Centos7上部署openstack ocata配置详解

    原文:http://www.cnblogs.com/yaohong/p/7601470.html 随笔-124  文章-2  评论-82  Centos7上部署openstack ocata配置详解 ...

  9. c3p0-config.xml模板详解

    c3p0-config.xml模板详解 <c3p0-config> <default-config> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数.De ...

随机推荐

  1. FontLab

    FontLab 字体制作软件

  2. 【转】Senior Data Structure · 浅谈线段树(Segment Tree)

    本文章转自洛谷 原作者: _皎月半洒花 一.简介线段树 ps: _此处以询问区间和为例.实际上线段树可以处理很多符合结合律的操作.(比如说加法,a[1]+a[2]+a[3]+a[4]=(a[1]+a[ ...

  3. 大数据之路week06--day07(Hadoop常用命令)

    一.前述 分享一篇hadoop的常用命令的总结,将常用的Hadoop命令总结如下. 二.具体 1.启动hadoop所有进程start-all.sh等价于start-dfs.sh + start-yar ...

  4. 0014SpringBoot结合thymeleaf实现登录功能

    该登录功能需要实现的需求如下: 1.输入用户名密码,如果验证通过,进入首页,并显示登录的用户名 2.如果验证不通过,则重新进入登录页面,并显示“用户名密码错误” 3.如果未经登录,不能直接访问首页等静 ...

  5. Mac---使用tree生成目录结构

    作为测试或者程序员,平时都有需求来生成目录树,进行项目层级的讲解等.如下是样式图: 实现方式,即操作步骤: Mac下使用 brew install tree 进行安装,安装后,在terminal中输入 ...

  6. Web前端 --- BOM和DOM

    目录 前端基础之BOM和DOM BOM DOM 前端基础之BOM和DOM BOM是指浏览器对象模型,他使JavaScript有能力与浏览器进行对话 DOM是指文档对象模型,通过它,可以访问HTML文档 ...

  7. python实现字符串中如果遇到连续重复的字符只出现一次非去重

    需求:在一个字符串中, 如果遇到连续重复的字符只出现一个,(不是去重) 例:str1 = 'aabbccddaabbccdd' 输出结果为:‘abcdabcd’ 具体实现代码如下: def func( ...

  8. [Luogu] 运输问题 -- 00

    https://www.luogu.org/problemnew/show/4015 #include <bits/stdc++.h> #define gc getchar() using ...

  9. Ubuntu输入ifconfig找不到IP地址,只有lo问题

    首先我的问题是这样的 然后一顿神百度,要找到你之前用的网卡或者设备,ifconfig -a,然后好用,出来了 但是并没有IP地址什么的,网上给的重启命令也没有用 输入的命令是:ifconfig ens ...

  10. thinkphp5/php cors跨域处理

    现在做项目,很多都是前后端分离.也就是前段,后端都有自己的域名. 那么前段请求后端接口的时候,就会出现跨域问题.出现跨域的问题,主要 是浏览器的安全策略-同源策略.那么怎么解决跨域问题呢,抛出主角 C ...