Puppet / Compute: allow to run Ephemeral only storage with RBD
[apex-tripleo-heat-templates.git] / os-apply-config / compute.yaml
1 heat_template_version: 2015-04-30
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   CinderEnableNfsBackend:
29     default: false
30     description: Whether to enable or not the NFS backend for Cinder
31     type: boolean
32   CinderEnableRbdBackend:
33     default: false
34     description: Whether to enable or not the Rbd backend for Cinder
35     type: boolean
36   Debug:
37     default: ''
38     description: Set to True to enable debugging on all services.
39     type: string
40   ExtraConfig:
41     default: {}
42     description: |
43       Additional configuration to inject into the cluster. The JSON should have
44       the following structure:
45         {"FILEKEY":
46           {"config":
47             [{"section": "SECTIONNAME",
48               "values":
49                 [{"option": "OPTIONNAME",
50                   "value": "VALUENAME"
51                  }
52                 ]
53              }
54             ]
55           }
56         }
57       For instance:
58         {"nova":
59           {"config":
60             [{"section": "default",
61               "values":
62                 [{"option": "force_config_drive",
63                   "value": "always"
64                  }
65                 ]
66              },
67              {"section": "cells",
68               "values":
69                 [{"option": "driver",
70                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
71                  }
72                 ]
73              }
74             ]
75           }
76         }
77     type: json
78   Flavor:
79     description: Flavor for the nova compute node
80     type: string
81     constraints:
82       - custom_constraint: nova.flavor
83   GlanceHost:
84     type: string
85     default: ''  # Has to be here because of the ignored empty value bug
86   GlancePort:
87     default: "9292"
88     description: Glance port.
89     type: string
90   GlanceProtocol:
91     default: http
92     description: Protocol to use when connecting to glance, set to https for SSL.
93     type: string
94   Image:
95     type: string
96     default: overcloud-compute
97     constraints:
98       - custom_constraint: glance.image
99   ImageUpdatePolicy:
100     default: 'REBUILD_PRESERVE_EPHEMERAL'
101     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
102     type: string
103   KeyName:
104     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
105     type: string
106     default: default
107     constraints:
108       - custom_constraint: nova.keypair
109   KeystoneAdminApiVirtualIP:
110     type: string
111     default: ''
112   KeystonePublicApiVirtualIP:
113     type: string
114     default: ''
115   NeutronBridgeMappings:
116     description: >
117       The OVS logical->physical bridge mappings to use. See the Neutron
118       documentation for details. Defaults to mapping br-ex - the external
119       bridge on hosts - to a physical name 'datacentre' which can be used
120       to create provider networks (and we use this for the default floating
121       network) - if changing this either use different post-install network
122       scripts or be sure to keep 'datacentre' as a mapping network name.
123     type: string
124     default: "datacentre:br-ex"
125   NeutronEnableTunnelling:
126     type: string
127     default: "True"
128   NeutronFlatNetworks:
129     type: string
130     default: 'datacentre'
131     description: >
132       If set, flat networks to configure in neutron plugins.
133   NeutronHost:
134     type: string
135     default: ''  # Has to be here because of the ignored empty value bug
136   NeutronNetworkType:
137     type: string
138     description: The tenant network type for Neutron, either gre or vxlan.
139     default: 'vxlan'
140   NeutronNetworkVLANRanges:
141     default: 'datacentre'
142     description: >
143       The Neutron ML2 and OpenVSwitch vlan mapping range to support. See the
144       Neutron documentation for permitted values. Defaults to permitting any
145       VLAN on the 'datacentre' physical network (See NeutronBridgeMappings).
146     type: comma_delimited_list
147   NeutronPassword:
148     default: unset
149     description: The password for the neutron service account, used by neutron agents.
150     type: string
151     hidden: true
152   NeutronPhysicalBridge:
153     default: ''
154     description: An OVS bridge to create for accessing external networks.
155     type: string
156   NeutronPublicInterface:
157     default: nic1
158     description: A port to add to the NeutronPhysicalBridge.
159     type: string
160   NeutronTunnelTypes:
161     type: string
162     description: |
163         The tunnel types for the Neutron tenant network. To specify multiple
164         values, use a comma separated string, like so: 'gre,vxlan'
165     default: 'vxlan'
166   NeutronTunnelIdRanges:
167     description: |
168         Comma-separated list of <tun_min>:<tun_max> tuples enumerating ranges
169         of GRE tunnel IDs that are available for tenant network allocation
170     default: ["1:1000", ]
171     type: comma_delimited_list
172   NeutronVniRanges:
173     description: |
174         Comma-separated list of <vni_min>:<vni_max> tuples enumerating ranges
175         of VXLAN VNI IDs that are available for tenant network allocation
176     default: ["1:1000", ]
177     type: comma_delimited_list
178   NeutronPublicInterfaceRawDevice:
179     default: ''
180     type: string
181   NeutronDVR:
182     default: 'False'
183     type: string
184   NeutronMetadataProxySharedSecret:
185     default: 'unset'
186     description: Shared secret to prevent spoofing
187     type: string
188   NeutronCorePlugin:
189     default: "ml2"
190     description: |
191         The core plugin for Neutron. The value should be the entrypoint to be loaded
192         from neutron.core_plugins namespace.
193     type: string
194   NeutronServicePlugins:
195     default: "router"
196     description: |
197         Comma-separated list of service plugin entrypoints to be loaded from the
198         neutron.service_plugins namespace.
199     type: comma_delimited_list
200   NeutronTypeDrivers:
201     default: "vxlan,vlan,flat,gre"
202     description: |
203         Comma-separated list of network type driver entrypoints to be loaded.
204     type: comma_delimited_list
205   NeutronMechanismDrivers:
206     default: 'openvswitch'
207     description: |
208         The mechanism drivers for the Neutron tenant network. To specify multiple
209         values, use a comma separated string, like so: 'openvswitch,l2_population'
210     type: string
211   # Not relevant for Computes, should be removed
212   NeutronAllowL3AgentFailover:
213     default: 'True'
214     description: Allow automatic l3-agent failover
215     type: string
216   # Not relevant for Computes, should be removed
217   NeutronL3HA:
218     default: 'False'
219     description: Whether to enable l3-agent HA
220     type: string
221   NeutronAgentMode:
222     default: 'dvr_snat'
223     description: Agent mode for the neutron-l3-agent on the controller hosts
224     type: string
225   NovaApiHost:
226     type: string
227     default: ''  # Has to be here because of the ignored empty value bug
228   NovaComputeDriver:
229     type: string
230     default: libvirt.LibvirtDriver
231   NovaComputeExtraConfig:
232     default: {}
233     description: |
234       NovaCompute specific configuration to inject into the cluster. Same
235       structure as ExtraConfig.
236     type: json
237   NovaComputeLibvirtType:
238     type: string
239     default: ''
240   NovaEnableRbdBackend:
241     default: false
242     description: Whether to enable or not the Rbd backend for Nova
243     type: boolean
244   NovaPassword:
245     default: unset
246     description: The password for the nova service account, used by nova-api.
247     type: string
248     hidden: true
249   NovaPublicIP:
250     type: string
251     default: ''  # Has to be here because of the ignored empty value bug
252   NtpServer:
253     type: string
254     default: ''
255   RabbitHost:
256     type: string
257     default: ''  # Has to be here because of the ignored empty value bug
258   RabbitPassword:
259     default: guest
260     description: The password for RabbitMQ
261     type: string
262     hidden: true
263   RabbitUserName:
264     default: guest
265     description: The username for RabbitMQ
266     type: string
267   RabbitClientUseSSL:
268     default: false
269     description: >
270         Rabbit client subscriber parameter to specify
271         an SSL connection to the RabbitMQ host.
272     type: string
273   RabbitClientPort:
274     default: 5672
275     description: Set rabbit subscriber port, change this if using SSL
276     type: number
277   SnmpdReadonlyUserName:
278     default: ro_snmp_user
279     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
280     type: string
281   SnmpdReadonlyUserPassword:
282     default: unset
283     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
284     type: string
285     hidden: true
286   ServiceNetMap:
287     default: {}
288     description: Mapping of service_name -> network name. Typically set
289                  via parameter_defaults in the resource registry.
290     type: json
291   UpdateIdentifier:
292     default: ''
293     type: string
294     description: >
295       Setting to a previously unused value during stack-update will trigger
296       package update on all nodes
297   Hostname:
298     type: string
299     default: '' # Defaults to Heat created hostname
300
301 resources:
302
303   NovaCompute:
304     type: OS::Nova::Server
305     properties:
306       image:
307         {get_param: Image}
308       image_update_policy:
309         get_param: ImageUpdatePolicy
310       flavor: {get_param: Flavor}
311       key_name: {get_param: KeyName}
312       networks:
313         - network: ctlplane
314       user_data_format: SOFTWARE_CONFIG
315       user_data: {get_resource: NodeUserData}
316       name: {get_param: Hostname}
317
318   NodeUserData:
319     type: OS::TripleO::NodeUserData
320
321   InternalApiPort:
322     type: OS::TripleO::Compute::Ports::InternalApiPort
323     properties:
324       ControlPlaneIP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
325
326   StoragePort:
327     type: OS::TripleO::Compute::Ports::StoragePort
328     properties:
329       ControlPlaneIP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
330
331   TenantPort:
332     type: OS::TripleO::Compute::Ports::TenantPort
333     properties:
334       ControlPlaneIP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
335
336   NetworkConfig:
337     type: OS::TripleO::Compute::Net::SoftwareConfig
338     properties:
339       ControlPlaneIp: {get_attr: [NovaCompute, networks, ctlplane, 0]}
340       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
341       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
342       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
343
344   NetworkDeployment:
345     type: OS::TripleO::SoftwareDeployment
346     properties:
347       signal_transport: NO_SIGNAL
348       config: {get_resource: NetworkConfig}
349       server: {get_resource: NovaCompute}
350       input_values:
351         bridge_name: {get_param: NeutronPhysicalBridge}
352         interface_name: {get_param: NeutronPublicInterface}
353
354   NovaComputeConfig:
355     type: OS::Heat::StructuredConfig
356     properties:
357       group: os-apply-config
358       config:
359         nova:
360           compute_driver: { get_input: nova_compute_driver }
361           compute_libvirt_type: { get_input: nova_compute_libvirt_type }
362           debug: {get_input: debug}
363           host: {get_input: nova_api_host}
364           public_ip: {get_input: nova_public_ip}
365           service-password: {get_input: nova_password}
366         ceilometer:
367           debug: {get_input: debug}
368           metering_secret: {get_input: ceilometer_metering_secret}
369           service-password: {get_input: ceilometer_password}
370           compute_agent: {get_input: ceilometer_compute_agent}
371         snmpd:
372           export_MIB: UCD-SNMP-MIB
373           readonly_user_name: {get_input: snmpd_readonly_user_name}
374           readonly_user_password: {get_input: snmpd_readonly_user_password}
375         glance:
376           debug: {get_input: debug}
377           host: {get_input: glance_host}
378           port: {get_input: glance_port}
379           protocol: {get_input: glance_protocol}
380         keystone:
381           debug: {get_input: debug}
382           host: {get_input: keystone_host}
383         neutron:
384           debug: {get_input: debug}
385           flat-networks: {get_input: neutron_flat_networks}
386           host: {get_input: neutron_host}
387           router_distributed: {get_input: neutron_router_distributed}
388           agent_mode: {get_input: neutron_agent_mode}
389           ovs_db: {get_input: neutron_dsn}
390           metadata_proxy_shared_secret: {get_input: neutron_metadata_proxy_shared_secret}
391           core_plugin: {get_input: neutron_core_plugin}
392           service_plugins: {get_input: neutron_service_plugins}
393           type_drivers: {get_input: neutron_type_drivers}
394           mechanism_drivers: {get_input: neutron_mechanism_drivers}
395           allow_automatic_l3agent_failover: {get_input: neutron_allow_l3agent_failover}
396           l3_ha: {get_input: neutron_l3_ha}
397           ovs:
398             local_ip: {get_input: neutron_local_ip}
399             tenant_network_type: {get_input: neutron_tenant_network_type}
400             tunnel_types: {get_input: neutron_tunnel_types}
401             network_vlan_ranges: {get_input: neutron_network_vlan_ranges}
402             tunnel_id_ranges: {get_input: neutron_tunnel_id_ranges}
403             vni_ranges: {get_input: neutron_vni_ranges}
404             bridge_mappings: {get_input: neutron_bridge_mappings}
405             enable_tunneling: {get_input: neutron_enable_tunneling}
406             physical_bridge: {get_input: neutron_physical_bridge}
407             public_interface: {get_input: neutron_public_interface}
408             public_interface_raw_device: {get_input: neutron_public_interface_raw_device}
409           service-password: {get_input: neutron_password}
410         admin-password: {get_input: admin_password}
411         rabbit:
412           host: {get_input: rabbit_host}
413           username: {get_input: rabbit_username}
414           password: {get_input: rabbit_password}
415         ntp:
416           servers:
417               - {server: {get_input: ntp_server}}
418
419   NovaComputeDeployment:
420     type: OS::TripleO::SoftwareDeployment
421     properties:
422       signal_transport: NO_SIGNAL
423       config: {get_resource: NovaComputeConfig}
424       server: {get_resource: NovaCompute}
425       input_values:
426         debug: {get_param: Debug}
427         nova_compute_driver: {get_param: NovaComputeDriver}
428         nova_compute_libvirt_type: {get_param: NovaComputeLibvirtType}
429         nova_public_ip: {get_param: NovaPublicIP}
430         nova_api_host: {get_param: NovaApiHost}
431         nova_password: {get_param: NovaPassword}
432         ceilometer_metering_secret: {get_param: CeilometerMeteringSecret}
433         ceilometer_password: {get_param: CeilometerPassword}
434         ceilometer_compute_agent: {get_param: CeilometerComputeAgent}
435         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
436         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
437         glance_host: {get_param: GlanceHost}
438         glance_port: {get_param: GlancePort}
439         glance_protocol: {get_param: GlanceProtocol}
440         keystone_host: {get_param: KeystonePublicApiVirtualIP}
441         neutron_flat_networks: {get_param: NeutronFlatNetworks}
442         neutron_host: {get_param: NeutronHost}
443         neutron_local_ip: {get_attr: [NovaCompute, networks, ctlplane, 0]}
444         neutron_tenant_network_type: {get_param: NeutronNetworkType}
445         neutron_tunnel_types: {get_param: NeutronTunnelTypes}
446         neutron_tunnel_id_ranges:
447           str_replace:
448             template: "['RANGES']"
449             params:
450               RANGES:
451                 list_join:
452                 - "','"
453                 - {get_param: NeutronTunnelIdRanges}
454         neutron_vni_ranges:
455           str_replace:
456             template: "['RANGES']"
457             params:
458               RANGES:
459                 list_join:
460                 - "','"
461                 - {get_param: NeutronVniRanges}
462         neutron_network_vlan_ranges: {get_param: NeutronNetworkVLANRanges}
463         neutron_bridge_mappings: {get_param: NeutronBridgeMappings}
464         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
465         neutron_physical_bridge: {get_param: NeutronPhysicalBridge}
466         neutron_public_interface: {get_param: NeutronPublicInterface}
467         neutron_password: {get_param: NeutronPassword}
468         neutron_agent_mode: {get_param: NeutronAgentMode}
469         neutron_router_distributed: {get_param: NeutronDVR}
470         neutron_metadata_proxy_shared_secret: {get_param: NeutronMetadataProxySharedSecret}
471         neutron_core_plugin: {get_param: NeutronCorePlugin}
472         neutron_service_plugins:
473           str_replace:
474             template: "['PLUGINS']"
475             params:
476               PLUGINS:
477                 list_join:
478                 - "','"
479                 - {get_param: NeutronServicePlugins}
480         neutron_type_drivers:
481           str_replace:
482             template: "['DRIVERS']"
483             params:
484               DRIVERS:
485                 list_join:
486                 - "','"
487                 - {get_param: NeutronTypeDrivers}
488         neutron_mechanism_drivers: {get_param: NeutronMechanismDrivers}
489         neutron_allow_l3agent_failover: {get_param: NeutronAllowL3AgentFailover}
490         neutron_l3_ha: {get_param: NeutronL3HA}
491         neutron_public_interface_raw_device: {get_param: NeutronPublicInterfaceRawDevice}
492         admin_password: {get_param: AdminPassword}
493         rabbit_host: {get_param: RabbitHost}
494         rabbit_username: {get_param: RabbitUserName}
495         rabbit_password: {get_param: RabbitPassword}
496         ntp_server: {get_param: NtpServer}
497
498   NovaComputePassthrough:
499     type: OS::Heat::StructuredConfig
500     properties:
501       group: os-apply-config
502       config: {get_input: passthrough_config}
503
504   NovaComputePassthroughSpecific:
505     type: OS::Heat::StructuredConfig
506     properties:
507       group: os-apply-config
508       config: {get_input: passthrough_config_specific}
509
510   NovaComputePassthroughDeployment:
511     depends_on: [NovaComputeDeployment]
512     type: OS::Heat::StructuredDeployment
513     properties:
514       config: {get_resource: NovaComputePassthrough}
515       server: {get_resource: NovaCompute}
516       signal_transport: NO_SIGNAL
517       input_values:
518         passthrough_config: {get_param: ExtraConfig}
519
520   NovaComputePassthroughDeploymentSpecific:
521     depends_on: [NovaComputePassthroughDeployment]
522     type: OS::Heat::StructuredDeployment
523     properties:
524       config: {get_resource: NovaComputePassthroughSpecific}
525       server: {get_resource: NovaCompute}
526       signal_transport: NO_SIGNAL
527       input_values:
528         passthrough_config_specific: {get_param: NovaComputeExtraConfig}
529
530 outputs:
531   ip_address:
532     description: IP address of the server in the ctlplane network
533     value: {get_attr: [NovaCompute, networks, ctlplane, 0]}
534   internal_api_ip_address:
535     description: IP address of the server in the internal_api network
536     value: {get_attr: [InternalApiPort, ip_address]}
537   storage_ip_address:
538     description: IP address of the server in the storage network
539     value: {get_attr: [StoragePort, ip_address]}
540   tenant_ip_address:
541     description: IP address of the server in the tenant network
542     value: {get_attr: [TenantPort, ip_address]}
543   hostname:
544     description: Hostname of the server
545     value: {get_attr: [NovaCompute, name]}
546   hosts_entry:
547     description: >
548       Server's IP address and hostname in the /etc/hosts format
549     value:
550       str_replace:
551         template: "IP HOST"
552         params:
553           IP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
554           HOST: {get_attr: [NovaCompute, name]}
555   nova_server_resource:
556     description: Heat resource handle for the Nova compute server
557     value:
558       {get_resource: NovaCompute}
559   config_identifier:
560     description: identifier which changes if the node configuration may need re-applying
561     value: "None - NO_SIGNAL"