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