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