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