c2e9d218073fb5d1139b61e16f5a178293fcde19
[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     default: baremetal
74     constraints:
75       - custom_constraint: nova.flavor
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     constraints:
91       - custom_constraint: glance.image
92   ImageUpdatePolicy:
93     default: 'REBUILD_PRESERVE_EPHEMERAL'
94     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
95     type: string
96   KeyName:
97     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
98     type: string
99     default: default
100     constraints:
101       - custom_constraint: nova.keypair
102   KeystoneHost:
103     type: string
104     default: ''
105   NeutronBridgeMappings:
106     description: >
107       The OVS logical->physical bridge mappings to use. See the Neutron
108       documentation for details. Defaults to mapping br-ex - the external
109       bridge on hosts - to a physical name 'datacentre' which can be used
110       to create provider networks (and we use this for the default floating
111       network) - if changing this either use different post-install network
112       scripts or be sure to keep 'datacentre' as a mapping network name.
113     type: string
114     default: ""
115   NeutronEnableTunnelling:
116     type: string
117     default: "True"
118   NeutronFlatNetworks:
119     type: string
120     default: ''
121     description: >
122       If set, flat networks to configure in neutron plugins.
123   NeutronHost:
124     type: string
125     default: ''  # Has to be here because of the ignored empty value bug
126   NeutronNetworkType:
127     type: string
128     description: The tenant network type for Neutron, either gre or vxlan.
129     default: 'gre'
130   NeutronNetworkVLANRanges:
131     default: 'datacentre'
132     description: >
133       The Neutron ML2 and OpenVSwitch vlan mapping range to support. See the
134       Neutron documentation for permitted values. Defaults to permitting any
135       VLAN on the 'datacentre' physical network (See NeutronBridgeMappings).
136     type: string
137   NeutronPassword:
138     default: unset
139     description: The password for the neutron service account, used by neutron agents.
140     type: string
141     hidden: true
142   NeutronPhysicalBridge:
143     default: ''
144     description: An OVS bridge to create for accessing external networks.
145     type: string
146   NeutronPublicInterface:
147     default: eth0
148     description: A port to add to the NeutronPhysicalBridge.
149     type: string
150   NeutronTunnelTypes:
151     type: string
152     description: |
153         The tunnel types for the Neutron tenant network. To specify multiple
154         values, use a comma separated string, like so: 'gre,vxlan'
155     default: 'gre'
156   NeutronPublicInterfaceRawDevice:
157     default: ''
158     type: string
159   NeutronDVR:
160     default: 'False'
161     type: string
162   NeutronMetadataProxySharedSecret:
163     default: 'unset'
164     description: Shared secret to prevent spoofing
165     type: string
166   NeutronMechanismDrivers:
167     default: 'openvswitch'
168     description: |
169         The mechanism drivers for the Neutron tenant network. To specify multiple
170         values, use a comma separated string, like so: 'openvswitch,l2_population'
171     type: string
172   NeutronAllowL3AgentFailover:
173     default: 'True'
174     description: Allow automatic l3-agent failover
175     type: string
176   NeutronAgentMode:
177     default: 'dvr_snat'
178     description: Agent mode for the neutron-l3-agent on the controller hosts
179     type: string
180   NovaApiHost:
181     type: string
182     default: ''  # Has to be here because of the ignored empty value bug
183   NovaComputeDriver:
184     type: string
185     default: libvirt.LibvirtDriver
186   NovaComputeExtraConfig:
187     default: {}
188     description: |
189       NovaCompute specific configuration to inject into the cluster. Same
190       structure as ExtraConfig.
191     type: json
192   NovaComputeLibvirtType:
193     type: string
194     default: ''
195   NovaPassword:
196     default: unset
197     description: The password for the nova service account, used by nova-api.
198     type: string
199     hidden: true
200   NovaPublicIP:
201     type: string
202     default: ''  # Has to be here because of the ignored empty value bug
203   NtpServer:
204     type: string
205     default: ''
206   RabbitHost:
207     type: string
208     default: ''  # Has to be here because of the ignored empty value bug
209   RabbitPassword:
210     default: guest
211     description: The password for RabbitMQ
212     type: string
213     hidden: true
214   RabbitUserName:
215     default: guest
216     description: The username for RabbitMQ
217     type: string
218   SnmpdReadonlyUserName:
219     default: ro_snmp_user
220     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
221     type: string
222   SnmpdReadonlyUserPassword:
223     default: unset
224     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
225     type: string
226     hidden: true
227
228
229 resources:
230
231   NovaCompute:
232     type: OS::Nova::Server
233     properties:
234       image:
235         {get_param: Image}
236       image_update_policy:
237         get_param: ImageUpdatePolicy
238       flavor: {get_param: Flavor}
239       key_name: {get_param: KeyName}
240       networks:
241         - network: ctlplane
242       user_data_format: SOFTWARE_CONFIG
243
244   NovaComputeConfig:
245     type: OS::TripleO::Compute::SoftwareConfig
246
247   NovaComputeDeployment:
248     type: OS::TripleO::SoftwareDeployment
249     properties:
250       signal_transport: NO_SIGNAL
251       config: {get_attr: [NovaComputeConfig, config_id]}
252       server: {get_resource: NovaCompute}
253       input_values:
254         debug: {get_param: Debug}
255         nova_compute_driver: {get_param: NovaComputeDriver}
256         nova_compute_libvirt_type: {get_param: NovaComputeLibvirtType}
257         nova_public_ip: {get_param: NovaPublicIP}
258         nova_api_host: {get_param: NovaApiHost}
259         nova_password: {get_param: NovaPassword}
260         ceilometer_metering_secret: {get_param: CeilometerMeteringSecret}
261         ceilometer_password: {get_param: CeilometerPassword}
262         ceilometer_compute_agent: {get_param: CeilometerComputeAgent}
263         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
264         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
265         glance_host: {get_param: GlanceHost}
266         glance_port: {get_param: GlancePort}
267         glance_protocol: {get_param: GlanceProtocol}
268         keystone_host: {get_param: KeystoneHost}
269         neutron_flat_networks: {get_param: NeutronFlatNetworks}
270         neutron_host: {get_param: NeutronHost}
271         neutron_local_ip: {get_attr: [NovaCompute, networks, ctlplane, 0]}
272         neutron_tenant_network_type: {get_param: NeutronNetworkType}
273         neutron_tunnel_types: {get_param: NeutronTunnelTypes}
274         neutron_network_vlan_ranges: {get_param: NeutronNetworkVLANRanges}
275         neutron_bridge_mappings: {get_param: NeutronBridgeMappings}
276         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
277         neutron_physical_bridge: {get_param: NeutronPhysicalBridge}
278         neutron_public_interface: {get_param: NeutronPublicInterface}
279         neutron_password: {get_param: NeutronPassword}
280         neutron_agent_mode: {get_param: NeutronAgentMode}
281         neutron_router_distributed: {get_param: NeutronDVR}
282         neutron_metadata_proxy_shared_secret: {get_param: NeutronMetadataProxySharedSecret}
283         neutron_mechanism_drivers: {get_param: NeutronMechanismDrivers}
284         neutron_allow_l3agent_failover: {get_param: NeutronAllowL3AgentFailover}
285         neutron_public_interface_raw_device: {get_param: NeutronPublicInterfaceRawDevice}
286         admin_password: {get_param: AdminPassword}
287         rabbit_host: {get_param: RabbitHost}
288         rabbit_username: {get_param: RabbitUserName}
289         rabbit_password: {get_param: RabbitPassword}
290         ntp_server: {get_param: NtpServer}
291
292   NovaComputePassthrough:
293     type: OS::Heat::StructuredConfig
294     properties:
295       group: os-apply-config
296       config: {get_input: passthrough_config}
297
298   NovaComputePassthroughSpecific:
299     type: OS::Heat::StructuredConfig
300     properties:
301       group: os-apply-config
302       config: {get_input: passthrough_config_specific}
303
304   NovaComputePassthroughDeployment:
305     depends_on: [NovaComputeDeployment]
306     type: OS::Heat::StructuredDeployment
307     properties:
308       config: {get_resource: NovaComputePassthrough}
309       server: {get_resource: NovaCompute}
310       signal_transport: NO_SIGNAL
311       input_values:
312         passthrough_config: {get_param: ExtraConfig}
313
314   NovaComputePassthroughDeploymentSpecific:
315     depends_on: [NovaComputePassthroughDeployment]
316     type: OS::Heat::StructuredDeployment
317     properties:
318       config: {get_resource: NovaComputePassthroughSpecific}
319       server: {get_resource: NovaCompute}
320       signal_transport: NO_SIGNAL
321       input_values:
322         passthrough_config_specific: {get_param: NovaComputeExtraConfig}
323
324 outputs:
325   ip_address:
326     description: IP address of the server in the ctlplane network
327     value: {get_attr: [NovaCompute, networks, ctlplane, 0]}
328   hostname:
329     description: Hostname of the server
330     value: {get_attr: [NovaCompute, name]}
331   hosts_entry:
332     description: >
333       Server's IP address and hostname in the /etc/hosts format
334     value:
335       str_replace:
336         template: "IP HOST HOST.novalocal"
337         params:
338           IP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
339           HOST: {get_attr: [NovaCompute, name]}
340   nova_server_resource:
341     description: Heat resource handle for the Nova compute server
342     value:
343       {get_resource: NovaCompute}