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