Merge "Add block completion signal"
[apex-tripleo-heat-templates.git] / compute.yaml
1 heat_template_version: 2014-10-16
2
3 description: >
4   OpenStack hypervisor node. Can be wrapped in a ResourceGroup for scaling.
5
6 parameters:
7   AdminPassword:
8     default: unset
9     description: The password for the keystone admin account, used for monitoring, querying neutron etc.
10     type: string
11     hidden: true
12   CeilometerComputeAgent:
13     description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
14     type: string
15     default: ''
16     constraints:
17     - allowed_values: ['', Present]
18   CeilometerDSN:
19     type: string
20   CeilometerMeteringSecret:
21     default: unset
22     description: Secret shared by the ceilometer services.
23     type: string
24     hidden: true
25   CeilometerPassword:
26     default: unset
27     description: The password for the ceilometer service account.
28     type: string
29     hidden: true
30   Debug:
31     default: ''
32     description: Set to True to enable debugging on all services.
33     type: string
34   ExtraConfig:
35     default: {}
36     description: |
37       Additional configuration to inject into the cluster. The JSON should have
38       the following structure:
39         {"FILEKEY":
40           {"config":
41             [{"section": "SECTIONNAME",
42               "values":
43                 [{"option": "OPTIONNAME",
44                   "value": "VALUENAME"
45                  }
46                 ]
47              }
48             ]
49           }
50         }
51       For instance:
52         {"nova":
53           {"config":
54             [{"section": "default",
55               "values":
56                 [{"option": "force_config_drive",
57                   "value": "always"
58                  }
59                 ]
60              },
61              {"section": "cells",
62               "values":
63                 [{"option": "driver",
64                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
65                  }
66                 ]
67              }
68             ]
69           }
70         }
71     type: json
72   Flavor:
73     description: Flavor for the nova compute node
74     type: string
75     default: baremetal
76   GlanceHost:
77     type: string
78     default: ''  # Has to be here because of the ignored empty value bug
79   GlancePort:
80     default: "9292"
81     description: Glance port.
82     type: string
83   GlanceProtocol:
84     default: http
85     description: Protocol to use when connecting to glance, set to https for SSL.
86     type: string
87   Image:
88     type: string
89     default: overcloud-compute
90   ImageUpdatePolicy:
91     default: 'REBUILD_PRESERVE_EPHEMERAL'
92     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
93     type: string
94   KeyName:
95     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
96     type: string
97     default: default
98   KeystoneHost:
99     type: string
100     default: ''
101   LiveUpdateComputeImage:
102     type: string
103     description: The image ID for live-updates to the overcloud compute nodes.
104     default: ''
105   LiveUpdateHost:
106     type: string
107     description: The IP address for the undercloud Glance API.
108     default: ''
109   LiveUpdatePassword:
110     type: string
111     default: ''
112     description: The live-update password for the undercloud Glance API.
113     hidden: true
114   LiveUpdateTenantName:
115     type: string
116     description: The live-update tenant name for the undercloud Glance API.
117     default: ''
118   LiveUpdateUserName:
119     type: string
120     description: The live-update username for the undercloud Glance API.
121     default: ''
122   NeutronBridgeMappings:
123     description: >
124       The OVS logical->physical bridge mappings to use. See the Neutron
125       documentation for details. Defaults to mapping br-ex - the external
126       bridge on hosts - to a physical name 'datacentre' which can be used
127       to create provider networks (and we use this for the default floating
128       network) - if changing this either use different post-install network
129       scripts or be sure to keep 'datacentre' as a mapping network name.
130     type: string
131     default: ""
132   NeutronDSN:
133     type: string
134   NeutronEnableTunnelling:
135     type: string
136     default: "True"
137   NeutronFlatNetworks:
138     type: string
139     default: ''
140     description: >
141       If set, flat networks to configure in neutron plugins.
142   NeutronHost:
143     type: string
144     default: ''  # Has to be here because of the ignored empty value bug
145   NeutronNetworkType:
146     type: string
147     description: The tenant network type for Neutron, either gre or vxlan.
148     default: 'gre'
149   NeutronNetworkVLANRanges:
150     default: 'datacentre'
151     description: >
152       The Neutron ML2 and OpenVSwitch vlan mapping range to support. See the
153       Neutron documentation for permitted values. Defaults to permitting any
154       VLAN on the 'datacentre' physical network (See NeutronBridgeMappings).
155     type: string
156   NeutronPassword:
157     default: unset
158     description: The password for the neutron service account, used by neutron agents.
159     type: string
160     hidden: true
161   NeutronPhysicalBridge:
162     default: ''
163     description: An OVS bridge to create for accessing external networks.
164     type: string
165   NeutronPublicInterface:
166     default: ''
167     description: A port to add to the NeutronPhysicalBridge.
168     type: string
169   NeutronTunnelTypes:
170     type: string
171     description: |
172         The tunnel types for the Neutron tenant network. To specify multiple
173         values, use a comma separated string, like so: 'gre,vxlan'
174     default: 'gre'
175   NovaApiHost:
176     type: string
177     default: ''  # Has to be here because of the ignored empty value bug
178   NovaComputeDriver:
179     type: string
180     default: libvirt.LibvirtDriver
181   NovaComputeExtraConfig:
182     default: {}
183     description: |
184       NovaCompute specific configuration to inject into the cluster. Same
185       structure as ExtraConfig.
186     type: json
187   NovaComputeLibvirtType:
188     type: string
189     default: ''
190   NovaDSN:
191     type: string
192   NovaPassword:
193     default: unset
194     description: The password for the nova service account, used by nova-api.
195     type: string
196     hidden: true
197   NovaPublicIP:
198     type: string
199     default: ''  # Has to be here because of the ignored empty value bug
200   NtpServer:
201     type: string
202     default: ''
203   RabbitHost:
204     type: string
205     default: ''  # Has to be here because of the ignored empty value bug
206   RabbitPassword:
207     default: guest
208     description: The password for RabbitMQ
209     type: string
210     hidden: true
211   RabbitUserName:
212     default: guest
213     description: The username for RabbitMQ
214     type: string
215   SnmpdReadonlyUserName:
216     default: ro_snmp_user
217     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
218     type: string
219   SnmpdReadonlyUserPassword:
220     default: unset
221     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
222     type: string
223     hidden: true
224
225
226 resources:
227
228   NovaCompute:
229     type: OS::Nova::Server
230     properties:
231       image:
232         {get_param: Image}
233       image_update_policy:
234         get_param: ImageUpdatePolicy
235       flavor: {get_param: Flavor}
236       key_name: {get_param: KeyName}
237       networks:
238         - network: ctlplane
239       user_data_format: SOFTWARE_CONFIG
240
241   NovaComputeConfig:
242     type: OS::Heat::StructuredConfig
243     properties:
244       group: os-apply-config
245       config:
246         nova:
247           compute_driver: { get_input: nova_compute_driver }
248           compute_libvirt_type: { get_input: nova_compute_libvirt_type }
249           db: {get_input: nova_dsn}
250           debug: {get_param: Debug}
251           host: {get_input: nova_api_host}
252           public_ip: {get_input: nova_public_ip}
253           service-password: {get_input: nova_password}
254         ceilometer:
255           db: {get_input: ceilometer_dsn}
256           debug: {get_param: Debug}
257           metering_secret: {get_input: ceilometer_metering_secret}
258           service-password: {get_input: ceilometer_password}
259           compute_agent: {get_input: ceilometer_compute_agent}
260         snmpd:
261           export_MIB: UCD-SNMP-MIB
262           readonly_user_name: {get_input: snmpd_readonly_user_name}
263           readonly_user_password: {get_input: snmpd_readonly_user_password}
264         glance:
265           debug: {get_param: Debug}
266           host: {get_input: glance_host}
267           port: {get_input: glance_port}
268           protocol: {get_input: glance_protocol}
269         keystone:
270           debug: {get_param: Debug}
271           host: {get_input: keystone_host}
272         neutron:
273           debug: {get_param: Debug}
274           flat-networks: {get_input: neutron_flat_networks}
275           host: {get_input: neutron_host}
276           ovs_db: {get_input: neutron_dsn}
277           ovs:
278             local_ip: {get_input: neutron_local_ip}
279             tenant_network_type: {get_input: neutron_tenant_network_type}
280             tunnel_types: {get_input: neutron_tunnel_types}
281             network_vlan_ranges: {get_input: neutron_network_vlan_ranges}
282             bridge_mappings: {get_input: neutron_bridge_mappings}
283             enable_tunneling: {get_input: neutron_enable_tunneling}
284             physical_bridge: {get_input: neutron_physical_bridge}
285             public_interface: {get_input: neutron_public_interface}
286           service-password: {get_input: neutron_password}
287         admin-password: {get_input: admin_password}
288         rabbit:
289           host: {get_input: rabbit_host}
290           username: {get_input: rabbit_username}
291           password: {get_input: rabbit_password}
292         live-update:
293           host: {get_input: live_update_host}
294           username: {get_input: live_update_username}
295           password: {get_input: live_update_password}
296           tenant-name: {get_input: live_update_tenant_name}
297           base_image_id: {get_input: nova_image}
298           live_update_image_id: {get_input: live_update_compute_image}
299         ntp:
300           servers:
301               - {server: {get_input: ntp_server}, fudge: "stratum 0"}
302
303   NovaComputeDeployment:
304     type: OS::Heat::StructuredDeployment
305     properties:
306       signal_transport: NO_SIGNAL
307       config: {get_resource: NovaComputeConfig}
308       server: {get_resource: NovaCompute}
309       input_values:
310         nova_compute_driver: {get_param: NovaComputeDriver}
311         nova_compute_libvirt_type: {get_param: NovaComputeLibvirtType}
312         nova_dsn: {get_param: NovaDSN}
313         nova_public_ip: {get_param: NovaPublicIP}
314         nova_api_host: {get_param: NovaApiHost}
315         nova_password: {get_param: NovaPassword}
316         ceilometer_dsn: {get_param: CeilometerDSN}
317         ceilometer_metering_secret: {get_param: CeilometerMeteringSecret}
318         ceilometer_password: {get_param: CeilometerPassword}
319         ceilometer_compute_agent: {get_param: CeilometerComputeAgent}
320         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
321         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
322         glance_host: {get_param: GlanceHost}
323         glance_port: {get_param: GlancePort}
324         glance_protocol: {get_param: GlanceProtocol}
325         keystone_host: {get_param: KeystoneHost}
326         neutron_flat_networks: {get_param: NeutronFlatNetworks}
327         neutron_host: {get_param: NeutronHost}
328         neutron_dsn: {get_param: NeutronDSN}
329         neutron_local_ip: {get_attr: [NovaCompute, networks, ctlplane, 0]}
330         neutron_tenant_network_type: {get_param: NeutronNetworkType}
331         neutron_tunnel_types: {get_param: NeutronTunnelTypes}
332         neutron_network_vlan_ranges: {get_param: NeutronNetworkVLANRanges}
333         neutron_bridge_mappings: {get_param: NeutronBridgeMappings}
334         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
335         neutron_physical_bridge: {get_param: NeutronPhysicalBridge}
336         neutron_public_interface: {get_param: NeutronPublicInterface}
337         neutron_password: {get_param: NeutronPassword}
338         admin_password: {get_param: AdminPassword}
339         rabbit_host: {get_param: RabbitHost}
340         rabbit_username: {get_param: RabbitUserName}
341         rabbit_password: {get_param: RabbitPassword}
342         live_update_host: {get_param: LiveUpdateHost}
343         live_update_username: {get_param: LiveUpdateUserName}
344         live_update_password: {get_param: LiveUpdatePassword}
345         live_update_tenant_name: {get_param: LiveUpdateTenantName}
346         nova_image: {get_param: Image}
347         live_update_image_id: {get_param: LiveUpdateComputeImage}
348         ntp_server: {get_param: NtpServer}
349
350   NovaComputePassthrough:
351     type: OS::Heat::StructuredConfig
352     properties:
353       group: os-apply-config
354       config: {get_input: passthrough_config}
355
356   NovaComputePassthroughSpecific:
357     type: OS::Heat::StructuredConfig
358     properties:
359       group: os-apply-config
360       config: {get_input: passthrough_config_specific}
361
362   NovaComputePassthroughDeployment:
363     depends_on: [NovaComputeDeployment]
364     type: OS::Heat::StructuredDeployment
365     properties:
366       config: {get_resource: NovaComputePassthrough}
367       server: {get_resource: NovaCompute}
368       signal_transport: NO_SIGNAL
369       input_values:
370         passthrough_config: {get_param: ExtraConfig}
371
372   NovaComputePassthroughDeploymentSpecific:
373     depends_on: [NovaComputePassthroughDeployment]
374     type: OS::Heat::StructuredDeployment
375     properties:
376       config: {get_resource: NovaComputePassthroughSpecific}
377       server: {get_resource: NovaCompute}
378       signal_transport: NO_SIGNAL
379       input_values:
380         passthrough_config_specific: {get_param: NovaComputeExtraConfig}
381
382 outputs:
383   ip_address:
384     description: IP address of the server in the ctlplane network
385     value: {get_attr: [NovaCompute, networks, ctlplane, 0]}
386   hostname:
387     description: Hostname of the server
388     value: {get_attr: [NovaCompute, name]}
389   hosts_entry:
390     description: >
391       Server's IP address and hostname in the /etc/hosts format
392     value:
393       str_replace:
394         template: "IP HOST HOST.novalocal"
395         params:
396           IP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
397           HOST: {get_attr: [NovaCompute, name]}
398   nova_server_resource:
399     description: Heat resource handle for the Nova compute server
400     value:
401       {get_resource: NovaCompute}