|
|
楼主 |
发表于 2017-11-20 15:55:50
|
显示全部楼层
使用下面的内容创建``demo-template.yml``文件:
: B' _% C6 p0 l5 c3 R& b9 @2 }, ]
% A" m0 b i5 O" g b; f& Oheat_template_version: 2015-10-15# g# n' {0 o0 }& }6 C! B
description: Launch a basic instance using the ``m1.tiny`` flavor and one network.0 N9 S+ q0 g# I; {$ C
' y. g! _$ [1 `5 l1 h5 h2 gparameters:; ^5 m% n$ S1 @. B/ q
ImageID:# v4 F7 W8 P+ K8 t: D
type: string
3 |+ N5 W8 g* L+ Z. r7 ] P description: Image to use for the instance.6 O0 i3 C+ d7 [2 j t, c
NetID:' ~, ]" y8 {% P9 p
type: string
7 y5 ?8 A; c3 K) i1 V description: Network ID to use for the instance.1 L, }4 @3 a& ^* H- @. w
* P8 }# X3 u, Q$ Y2 y1 ~resources:
+ E- @( B$ i' _9 b/ z9 M server:
$ N. v/ w: N2 ?! i/ O2 s type: OS::Nova::Server3 Q/ H; f* e2 ?- g, u
properties:
8 |# k- ]6 V7 { image: { get_param: ImageID }- z `4 U' U- u9 q- B9 Y
flavor: m1.tiny8 ~/ o% }# C* k0 P
networks:
: x: |3 `9 t0 ? - network: { get_param: NetID }& X: B" d( D0 V
" T( N: E$ I( c. n G( Ioutputs:3 R; ~; O: ]% w, j- n( ^
instance_name:6 `$ \- g5 e1 o
description: Name of the instance.1 e* X' S9 P- e7 |- @/ S
value: { get_attr: [ server, name ] }; I4 d" o! v; i; u2 |9 {0 T+ D
instance_ip:
: a( j8 M7 F7 W' y. z. @0 g description: IP address of the instance.
: L, c8 W6 \% {& C& [5 E value: { get_attr: [ server, first_address ] } |
|