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