Merge "Compute all hosts matrix once"
[apex-tripleo-heat-templates.git] / overcloud-source.yaml
1 Description: Nova API,Keystone,Heat Engine and API,Glance,Neutron,Dedicated MySQL
2   server,Dedicated RabbitMQ Server,Group of Nova Computes
3 HeatTemplateFormatVersion: '2012-12-12'
4 Parameters:
5   AdminPassword:
6     Default: unset
7     Description: The password for the keystone admin account, used for monitoring, querying neutron etc.
8     Type: String
9     NoEcho: true
10   AdminToken:
11     Default: unset
12     Description: The keystone auth secret.
13     Type: String
14     NoEcho: true
15   CinderPassword:
16     Default: unset
17     Description: The password for the cinder service account, used by cinder-api.
18     Type: String
19     NoEcho: true
20   CinderISCSIHelper:
21     Default: tgtadm
22     Description: The iSCSI helper to use with cinder.
23     Type: String
24   CinderLVMLoopDeviceSize:
25     Default: 5000
26     Description: The size of the loopback file used by the cinder LVM driver.
27     Type: Number
28   ExtraConfig:
29     Default: {}
30     Description: |
31       Additional configuration to inject into the cluster. The JSON should have
32       the following structure:
33         {"FILEKEY":
34           {"config":
35             [{"section": "SECTIONNAME",
36               "values":
37                 [{"option": "OPTIONNAME",
38                   "value": "VALUENAME"
39                  }
40                 ]
41              }
42             ]
43           }
44         }
45       For instance:
46         {"nova":
47           {"config":
48             [{"section": "default",
49               "values":
50                 [{"option": "compute_manager",
51                   "value": "ironic.nova.compute.manager.ClusterComputeManager"
52                  }
53                 ]
54              },
55              {"section": "cells",
56               "values":
57                 [{"option": "driver",
58                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
59                  }
60                 ]
61              }
62             ]
63           }
64         }
65     Type: Json
66   OvercloudControlFlavor:
67     Default: baremetal
68     Description: Flavor for control nodes to request when deploying.
69     Type: String
70   OvercloudComputeFlavor:
71     Default: baremetal
72     Description: Flavor for compute nodes to request when deploying.
73     Type: String
74   GlancePort:
75     Default: 9292
76     Description: Glance port.
77     Type: String
78   GlanceProtocol:
79     Default: http
80     Description: Protocol to use when connecting to glance, set to https for SSL.
81     Type: String
82   GlancePassword:
83     Default: unset
84     Description: The password for the glance service account, used by the glance services.
85     Type: String
86     NoEcho: true
87   GlanceNotifierStrategy:
88     Description: Strategy to use for Glance notification queue
89     Type: String
90     Default: noop
91   GlanceLogFile:
92     Description: The filepath of the file to use for logging messages from Glance.
93     Type: String
94     Default: ''
95   HeatPassword:
96     Default: unset
97     Description: The password for the Heat service account, used by the Heat services.
98     Type: String
99     NoEcho: true
100   ImageUpdatePolicy:
101     Default: 'REBUILD_PRESERVE_EPHEMERAL'
102     Description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
103     Type: String
104   KeyName:
105     Default: default
106     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
107     Type: String
108   NeutronBridgeMappings:
109     Description: The OVS logical->physical bridge mappings to use.
110     Type: String
111     Default: ''
112   NeutronPassword:
113     Default: unset
114     Description: The password for the neutron service account, used by neutron agents.
115     Type: String
116     NoEcho: true
117   CeilometerComputeAgent:
118     Description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
119     Type: String
120     Default: ''
121     AllowedValues: ['', Present]
122   CeilometerMeteringSecret:
123     Default: unset
124     Description: Secret shared by the ceilometer services.
125     Type: String
126     NoEcho: true
127   CeilometerPassword:
128     Default: unset
129     Description: The password for the ceilometer service account.
130     Type: String
131     NoEcho: true
132   SnmpdReadonlyUserName:
133     Default: ro_snmp_user
134     Description: The user name for SNMPd with readonly rights running on all Overcloud nodes
135     Type: String
136   SnmpdReadonlyUserPassword:
137     Default: unset
138     Description: The user password for SNMPd with readonly rights running on all Overcloud nodes
139     Type: String
140     NoEcho: true
141   CloudName:
142     Default: ''
143     Description: The DNS name of this cloud. E.g. ci-overcloud.tripleo.org
144     Type: String
145   NovaComputeDriver:
146     Default: libvirt.LibvirtDriver
147     Type: String
148   NovaComputeLibvirtType:
149     Default: ''
150     Type: String
151   NovaImage:
152     Type: String
153     Default: overcloud-compute
154   NovaPassword:
155     Default: unset
156     Description: The password for the nova service account, used by nova-api.
157     Type: String
158     NoEcho: true
159   NeutronFlatNetworks:
160     Type: String
161     Default: ''
162     Description: If set, flat networks to configure in neutron plugins.
163   HypervisorNeutronPhysicalBridge:
164     Default: ''
165     Description: An OVS bridge to create on each hypervisor.
166     Type: String
167   HypervisorNeutronPublicInterface:
168     Default: ''
169     Description: What interface to add to the HypervisorNeutronPhysicalBridge.
170     Type: String
171   NeutronPublicInterface:
172     Default: eth0
173     Description: What interface to bridge onto br-ex for network nodes.
174     Type: String
175   NeutronPublicInterfaceDefaultRoute:
176     Default: ''
177     Description: A custom default route for the NeutronPublicInterface.
178     Type: String
179   NeutronPublicInterfaceIP:
180     Default: ''
181     Description: A custom IP address to put onto the NeutronPublicInterface.
182     Type: String
183   NeutronPublicInterfaceRawDevice:
184     Default: ''
185     Description: If set, the public interface is a vlan with this device as the raw device.
186     Type: String
187   NeutronControlPlaneID:
188     Default: ''
189     Type: String
190     Description: Neutron ID for ctlplane network.
191   NeutronDnsmasqOptions:
192     Default: 'dhcp-option-force=26,1400'
193     Description: Dnsmasq options for neutron-dhcp-agent. The default value here forces MTU to be set to 1400 to account for the gre tunnel overhead.
194     Type: String
195   controllerImage:
196     Type: String
197     Default: overcloud-control
198   NtpServer:
199     Type: String
200     Default: ''
201   RabbitUserName:
202     Default: guest
203     Description: The username for RabbitMQ
204     Type: String
205   RabbitPassword:
206     Default: guest
207     Description: The password for RabbitMQ
208     Type: String
209     NoEcho: true
210   RabbitCookieSalt:
211     Type: String
212     Default: unset
213     Description: Salt for the rabbit cookie, change this to force the randomly generated rabbit cookie to change.
214   HeatStackDomainAdminPassword:
215     Description: Password for heat_domain_admin user.
216     Type: String
217     Default: ''
218     NoEcho: true
219   LiveUpdateUserName:
220     Type: String
221     Description: The live-update username for the undercloud Glance API.
222     Default: ''
223   LiveUpdateTenantName:
224     Type: String
225     Description: The live-update tenant name for the undercloud Glance API.
226     Default: ''
227   LiveUpdateHost:
228     Type: String
229     Description: The IP address for the undercloud Glance API.
230     Default: ''
231   LiveUpdatePassword:
232     Type: String
233     Default: ''
234     Description: The live-update password for the undercloud Glance API.
235     NoEcho: true
236   LiveUpdateComputeImage:
237     Type: String
238     Description: The image ID for live-updates to the overcloud compute nodes.
239     Default: ''
240   MysqlInnodbBufferPoolSize:
241     Description: >
242         Specifies the size of the buffer pool in megabytes. Setting to
243         zero should be interpreted as "no value" and will defer to the
244         lower level default.
245     Type: Number
246     Default: 0
247   ControlVirtualInterface:
248     Default: 'br-ex'
249     Description: Interface where virtual ip will be assigned.
250     Type: String
251   ControlFixedIPs:
252     Default: []
253     Description: Should be used for arbitrary ips.
254     Type: Json
255   KeystoneCACertificate:
256     Default: ''
257     Description: Keystone self-signed certificate authority certificate.
258     Type: String
259   KeystoneSigningCertificate:
260     Default: ''
261     Description: Keystone certificate for verifying token validity.
262     Type: String
263   KeystoneSigningKey:
264     Default: ''
265     Description: Keystone key for signing tokens.
266     Type: String
267     NoEcho: true
268 Resources:
269   ControlVirtualIP:
270     Type: OS::Neutron::Port
271     Properties:
272       name: control_virtual_ip
273       network_id: {Ref: NeutronControlPlaneID}
274       fixed_ips:
275         Ref: ControlFixedIPs
276   MysqlClusterUniquePart:
277     Type: OS::Heat::RandomString
278     Properties:
279       length: 10
280   RabbitCookie:
281     Type: OS::Heat::RandomString
282     Properties:
283       length: 20
284       salt:
285         Ref: RabbitCookieSalt
286   NovaCompute0Config:
287     Type: FileInclude
288     Path: nova-compute-instance.yaml
289     SubKey: Resources.NovaCompute0Deploy
290     Parameters:
291         NovaApiHost: {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
292         KeystoneHost: {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
293         RabbitHost: {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
294         NeutronHost: {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
295         GlanceHost: {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
296         NovaDSN: {"Fn::Join": ['', ['mysql://nova:unset@', {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}, '/nova']]}
297         CeilometerDSN: {"Fn::Join": ['', ['mysql://ceilometer:unset@', {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}, '/ceilometer']]}
298         NeutronDSN: {"Fn::Join": ['', ['mysql://neutron:unset@', {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}, '/neutron']]}
299         NeutronNetworkType: "gre"
300         NeutronEnableTunnelling: "True"
301         NeutronFlatNetworks:
302             Ref: NeutronFlatNetworks
303         NeutronNetworkVLANRanges: ""
304         NeutronPhysicalBridge:
305             Ref: HypervisorNeutronPhysicalBridge
306         NeutronPublicInterface:
307             Ref: HypervisorNeutronPublicInterface
308         NeutronBridgeMappings:
309             Ref: NeutronBridgeMappings
310   NovaCompute0Hosts:
311     Type: FileInclude
312     Path: nova-compute-instance.yaml
313     SubKey: Resources.NovaCompute0HostsDeploy
314     Parameters:
315         HostsConfig: {Ref: allHostsConfig}
316   NovaCompute0Passthrough:
317     Type: OS::Heat::StructuredDeployment
318     Properties:
319       config: {Ref: NovaComputePassthrough}
320       server: {Ref: NovaCompute0}
321       signal_transport: NO_SIGNAL
322       input_values:
323         passthrough_config: {Ref: ExtraConfig}
324   NovaCompute0:
325     Type: FileInclude
326     Path: nova-compute-instance.yaml
327     SubKey: Resources.NovaCompute0
328   controllerConfig:
329     Type: OS::Heat::StructuredConfig
330     Properties:
331       group: os-apply-config
332       config:
333         completion-signal: {get_input: deploy_signal_id}
334         admin-password:
335           Ref: AdminPassword
336         admin-token:
337           Ref: AdminToken
338         bootstack:
339           public_interface_ip:
340             Ref: NeutronPublicInterfaceIP
341         bootstrap_host:
342           bootstrap_nodeid:
343             Fn::Select:
344             - 0
345             - Fn::Select:
346               - 0
347               - Merge::Map:
348                   controller0:
349                   - Fn::Select:
350                     - name
351                     - Fn::GetAtt:
352                       - controller0
353                       - show
354           nodeid: {get_input: bootstack_nodeid}
355         cinder:
356           db: mysql://cinder:unset@localhost/cinder
357           volume_size_mb:
358             Ref: CinderLVMLoopDeviceSize
359           service-password:
360             Ref: CinderPassword
361           iscsi-helper:
362             Ref: CinderISCSIHelper
363         controller-address:
364           get_input: controller_host
365         db-password: unset
366         glance:
367           registry:
368             host: {get_input: controller_virtual_ip}
369           backend: swift
370           db: mysql://glance:unset@localhost/glance
371           host:
372             get_input: controller_host
373           port:
374             Ref: GlancePort
375           protocol:
376             Ref: GlanceProtocol
377           service-password:
378             Ref: GlancePassword
379           swift-store-user: service:glance
380           swift-store-key:
381             Ref: GlancePassword
382           notifier-strategy:
383             Ref: GlanceNotifierStrategy
384           log-file:
385             Ref: GlanceLogFile
386         heat:
387           admin_password:
388             Ref: HeatPassword
389           admin_tenant_name: service
390           admin_user: heat
391           auth_encryption_key: unset___________
392           db: mysql://heat:unset@localhost/heat
393           stack_domain_admin_password: {Ref: HeatStackDomainAdminPassword}
394           watch_server_url: {get_input: heat.watch_server_url}
395           metadata_server_url: {get_input: heat.metadata_server_url}
396           waitcondition_server_url: {get_input: heat.waitcondition_server_url}
397         keystone:
398           db: mysql://keystone:unset@localhost/keystone
399           host:
400             get_input: controller_host
401           ca_certificate: {Ref: KeystoneCACertificate}
402           signing_key: {Ref: KeystoneSigningKey}
403           signing_certificate: {Ref: KeystoneSigningCertificate}
404         mysql:
405           innodb_buffer_pool_size: {Ref: MysqlInnodbBufferPoolSize}
406           nodes:
407             Merge::Map:
408               controller0:
409                 ip: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [controller0, networks]} ]} ] }
410           cluster_name:
411             Fn::Join:
412               - '-'
413               - - 'tripleo'
414                 - {Ref: MysqlClusterUniquePart}
415         neutron:
416           flat-networks: {Ref: NeutronFlatNetworks}
417           host: {get_input: controller_virtual_ip}
418           metadata_proxy_shared_secret: unset
419           ovs:
420             enable_tunneling: 'True'
421             local_ip:
422               get_input: controller_host
423             bridge_mappings: {Ref: NeutronBridgeMappings}
424             public_interface:
425               Ref: NeutronPublicInterface
426             public_interface_raw_device:
427               Ref: NeutronPublicInterfaceRawDevice
428             public_interface_route:
429               Ref: NeutronPublicInterfaceDefaultRoute
430             physical_bridge: br-ex
431             tenant_network_type: gre
432           ovs_db: mysql://neutron:unset@localhost/ovs_neutron?charset=utf8
433           service-password:
434             Ref: NeutronPassword
435           dnsmasq-options:
436             Ref: NeutronDnsmasqOptions
437         ceilometer:
438           db: mysql://ceilometer:unset@localhost/ceilometer
439           metering_secret: {Ref: CeilometerMeteringSecret}
440           service-password:
441             Ref: CeilometerPassword
442         snmpd:
443           export_MIB: UCD-SNMP-MIB
444           readonly_user_name:
445             Ref: SnmpdReadonlyUserName
446           readonly_user_password:
447             Ref: SnmpdReadonlyUserPassword
448         nova:
449           compute_driver: libvirt.LibvirtDriver
450           db: mysql://nova:unset@localhost/nova
451           default_floating_pool:
452             ext-net
453           host: {get_input: controller_virtual_ip}
454           metadata-proxy: true
455           service-password:
456             Ref: NovaPassword
457         rabbit:
458           host:
459             get_input: controller_host
460           username:
461             Ref: RabbitUserName
462           password:
463             Ref: RabbitPassword
464           cookie:
465             Fn::GetAtt:
466             - RabbitCookie
467             - value
468         ntp:
469           servers:
470               - {server: {Ref: NtpServer}, fudge: "stratum 0"}
471         keepalived:
472           keepalive_interface:
473             Ref: NeutronPublicInterface
474           priority: 101
475         virtual_ips:
476             -
477               ip: {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
478               interface:
479                 Ref: ControlVirtualInterface
480         haproxy:
481           nodes:
482             Merge::Map:
483               controller0:
484                 ip: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [controller0, networks]} ]} ] }
485                 name: {"Fn::Select": [ name, {"Fn::GetAtt": [controller0, show]} ] }
486           net_binds:
487             - ip: {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
488           services:
489             - name: keystone_admin
490               port: 35357
491             - name: keystone_public
492               port: 5000
493             - name: horizon
494               port: 80
495             - name: neutron
496               port: 9696
497             - name: cinder
498               port: 8776
499             - name: glance_api
500               port: 9292
501             - name: glance_registry
502               port: 9191
503             - name: heat_api
504               port: 8004
505             - name: heat_cloudwatch
506               port: 8003
507             - name: heat_cfn
508               port: 8000
509             - name: nova_ec2
510               port: 8773
511             - name: nova_osapi
512               port: 8774
513             - name: nova_metadata
514               port: 8775
515             - name: ceilometer
516               port: 8777
517             - name: swift_proxy_server
518               port: 8080
519   controllerPassthrough:
520     Type: OS::Heat::StructuredConfig
521     Properties:
522       group: os-apply-config
523       config: {get_input: passthrough_config}
524   controller0:
525     Type: OS::Nova::Server
526     Properties:
527       image:
528         Ref: controllerImage
529       image_update_policy:
530         Ref: ImageUpdatePolicy
531       flavor:
532         Ref: OvercloudControlFlavor
533       key_name:
534         Ref: KeyName
535       user_data_format: SOFTWARE_CONFIG
536   controller0Hosts:
537     Type: OS::Heat::StructuredDeployment
538     Properties:
539       config: {Ref: allHostsConfig}
540       server: {Ref: controller0}
541       signal_transport: NO_SIGNAL
542   controller0Deployment:
543     Type: OS::Heat::StructuredDeployment
544     Properties:
545       config: {Ref: controllerConfig}
546       server: {Ref: controller0}
547       input_values:
548         bootstack_nodeid:
549           Fn::Select:
550           - name
551           - Fn::GetAtt:
552             - controller0
553             - show
554         controller_host:
555           Fn::Select:
556             - 0
557             - Fn::Select:
558               - ctlplane
559               - Fn::GetAtt:
560                 - controller0
561                 - networks
562         controller_virtual_ip:
563           {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
564         heat.watch_server_url:
565           Fn::Join:
566             - ''
567             - - 'http://'
568               - {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
569               - ':8003'
570         heat.metadata_server_url:
571           Fn::Join:
572             - ''
573             - - 'http://'
574               - {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
575               - ':8000'
576         heat.waitcondition_server_url:
577           Fn::Join:
578             - ''
579             - - 'http://'
580               - {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
581               - ':8000/v1/waitcondition'
582   allHostsConfig:
583     Type: OS::Heat::StructuredConfig
584     Properties:
585       config:
586         hosts:
587           Fn::Join:
588           - "\n"
589           - - Fn::Join:
590               - "\n"
591               - Merge::Map:
592                   NovaCompute0:
593                     Fn::Join:
594                     - ' '
595                     - - Fn::Select:
596                         - 0
597                         - Fn::Select:
598                           - ctlplane
599                           - Fn::GetAtt:
600                             - NovaCompute0
601                             - networks
602                       - Fn::Select:
603                         - name
604                         - Fn::GetAtt:
605                           - NovaCompute0
606                           - show
607                       - Fn::Join:
608                         - '.'
609                         - - Fn::Select:
610                             - name
611                             - Fn::GetAtt:
612                               - NovaCompute0
613                               - show
614                           - 'novalocal'
615             - Fn::Join:
616               - "\n"
617               - Merge::Map:
618                   controller0:
619                     Fn::Join:
620                     - ' '
621                     - - Fn::Select:
622                         - 0
623                         - Fn::Select:
624                           - ctlplane
625                           - Fn::GetAtt:
626                             - controller0
627                             - networks
628                       - Fn::Select:
629                         - name
630                         - Fn::GetAtt:
631                           - controller0
632                           - show
633                       - Fn::Join:
634                         - '.'
635                         - - Fn::Select:
636                             - name
637                             - Fn::GetAtt:
638                               - controller0
639                               - show
640                           - 'novalocal'
641                       - {Ref: CloudName}
642   controller0SSLDeployment:
643     Type: OS::Heat::StructuredDeployment
644     Properties:
645       config: {Ref: SSLConfig}
646       server: {Ref: controller0}
647       signal_transport: NO_SIGNAL
648       input_values:
649         ssl_certificate: {Ref: SSLCertificate}
650         ssl_key: {Ref: SSLKey}
651         ssl_ca_certificate: {Ref: SSLCACertificate}
652   controller0Passthrough:
653     Type: OS::Heat::StructuredDeployment
654     Properties:
655       config: {Ref: controllerPassthrough}
656       server: {Ref: controller0}
657       signal_transport: NO_SIGNAL
658       input_values:
659         passthrough_config: {Ref: ExtraConfig}
660 Outputs:
661   KeystoneURL:
662     Description: URL for the Overcloud Keystone service
663     Value:
664       Fn::Join:
665       - ''
666       - - http://
667         - Fn::Select:
668           - ip_address
669           - Fn::Select:
670             - 0
671             - Fn::GetAtt:
672               - ControlVirtualIP
673               - fixed_ips
674         - :5000/v2.0/