|
|
楼主 |
发表于 2017-11-20 15:55:50
|
显示全部楼层
使用下面的内容创建``demo-template.yml``文件:7 g- u9 A' {' n, z
- X8 i& e3 G) G- J1 I
heat_template_version: 2015-10-15
- N2 v9 n8 T( Q+ Y! [description: Launch a basic instance using the ``m1.tiny`` flavor and one network.
4 d4 i) \" T& W& U! @. G
6 Q: B, N k/ l( m% Bparameters:6 ?0 p0 Z* F' F0 u
ImageID:0 J7 b* ]8 }; G( p- D0 P4 u
type: string( b1 i( u# E3 E. o
description: Image to use for the instance.3 W5 e) q: _0 T5 k+ O
NetID:8 o( v* U* Z |$ k3 s; y% ]
type: string
: Z1 ]/ I* c. G; V description: Network ID to use for the instance.
. e3 I3 S" N, U9 x" _5 `2 c& J0 [! D/ k4 B) b& M
resources:
/ b; a N( x: j1 ^" w- w* D$ f% k server:
+ h* p+ ?9 G8 x4 j8 G. t type: OS::Nova::Server3 j: F( c) B- G
properties:
) @ X) j2 r9 |0 N image: { get_param: ImageID }( d2 G. d* t) \5 k
flavor: m1.tiny
5 |2 a+ f% o( N& p& w: ]" d networks:
9 j- l3 G0 M1 V& _+ i - network: { get_param: NetID }
$ f' @/ `. D/ S3 G9 C
7 R8 y9 h. e" E4 R6 u4 Foutputs:
1 W& F3 c Y. b; ^. L$ E+ e, y3 M instance_name:$ t+ [ R+ n5 Y8 s c6 e; A
description: Name of the instance.3 C e& y4 z- @& K. G; y
value: { get_attr: [ server, name ] }
* S8 f; I" Z3 C) q2 Y5 O7 [ instance_ip:; O7 j$ l. O4 c# G! R6 q" E# G
description: IP address of the instance.
0 s |5 Q9 t" ^ r value: { get_attr: [ server, first_address ] } |
|