Use parameter constraints for image, key and flavor
[apex-tripleo-heat-templates.git] / controller.yaml
1 heat_template_version: 2014-10-16
2
3 description: >
4   OpenStack control plane 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   AdminToken:
13     default: unset
14     description: The keystone auth secret.
15     type: string
16     hidden: true
17   CeilometerMeteringSecret:
18     default: unset
19     description: Secret shared by the ceilometer services.
20     type: string
21     hidden: true
22   CeilometerPassword:
23     default: unset
24     description: The password for the ceilometer service account.
25     type: string
26     hidden: true
27   CinderISCSIHelper:
28     default: tgtadm
29     description: The iSCSI helper to use with cinder.
30     type: string
31   CinderLVMLoopDeviceSize:
32     default: 5000
33     description: The size of the loopback file used by the cinder LVM driver.
34     type: number
35   CinderPassword:
36     default: unset
37     description: The password for the cinder service account, used by cinder-api.
38     type: string
39     hidden: true
40   CloudName:
41     default: ''
42     description: The DNS name of this cloud. E.g. ci-overcloud.tripleo.org
43     type: string
44   ControllerExtraConfig:
45     default: {}
46     description: |
47       Controller specific configuration to inject into the cluster. Same
48       structure as ExtraConfig.
49     type: json
50   ControlVirtualInterface:
51     default: 'br-ex'
52     description: Interface where virtual ip will be assigned.
53     type: string
54   Debug:
55     default: ''
56     description: Set to True to enable debugging on all services.
57     type: string
58   ExtraConfig:
59     default: {}
60     description: |
61       Additional configuration to inject into the cluster. The JSON should have
62       the following structure:
63         {"FILEKEY":
64           {"config":
65             [{"section": "SECTIONNAME",
66               "values":
67                 [{"option": "OPTIONNAME",
68                   "value": "VALUENAME"
69                  }
70                 ]
71              }
72             ]
73           }
74         }
75       For instance:
76         {"nova":
77           {"config":
78             [{"section": "default",
79               "values":
80                 [{"option": "compute_manager",
81                   "value": "ironic.nova.compute.manager.ClusterComputeManager"
82                  }
83                 ]
84              },
85              {"section": "cells",
86               "values":
87                 [{"option": "driver",
88                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
89                  }
90                 ]
91              }
92             ]
93           }
94         }
95     type: json
96   Flavor:
97     default: baremetal
98     description: Flavor for control nodes to request when deploying.
99     type: string
100     constraints:
101       - custom_constraint: nova.flavor
102   GlanceNotifierStrategy:
103     description: Strategy to use for Glance notification queue
104     type: string
105     default: noop
106   GlanceLogFile:
107     description: The filepath of the file to use for logging messages from Glance.
108     type: string
109     default: ''
110   GlancePassword:
111     default: unset
112     description: The password for the glance service account, used by the glance services.
113     type: string
114     hidden: true
115   GlancePort:
116     default: "9292"
117     description: Glance port.
118     type: string
119   GlanceProtocol:
120     default: http
121     description: Protocol to use when connecting to glance, set to https for SSL.
122     type: string
123   HeatPassword:
124     default: unset
125     description: The password for the Heat service account, used by the Heat services.
126     type: string
127     hidden: true
128   HeatStackDomainAdminPassword:
129     description: Password for heat_domain_admin user.
130     type: string
131     default: ''
132     hidden: true
133   Image:
134     type: string
135     default: overcloud-control
136     constraints:
137       - custom_constraint: glance.image
138   ImageUpdatePolicy:
139     default: 'REBUILD_PRESERVE_EPHEMERAL'
140     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
141     type: string
142   KeyName:
143     default: default
144     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
145     type: string
146     constraints:
147       - custom_constraint: nova.keypair
148   KeystoneCACertificate:
149     default: ''
150     description: Keystone self-signed certificate authority certificate.
151     type: string
152   KeystoneSigningCertificate:
153     default: ''
154     description: Keystone certificate for verifying token validity.
155     type: string
156   KeystoneSigningKey:
157     default: ''
158     description: Keystone key for signing tokens.
159     type: string
160     hidden: true
161   MysqlClusterUniquePart:
162     description: A unique identifier of the MySQL cluster the controller is in.
163     type: string
164     default: 'unset'  # Has to be here because of the ignored empty value bug
165     constraints:
166     - length: {min: 4, max: 10}
167   MysqlInnodbBufferPoolSize:
168     description: >
169         Specifies the size of the buffer pool in megabytes. Setting to
170         zero should be interpreted as "no value" and will defer to the
171         lower level default.
172     type: number
173     default: 0
174   MysqlRootPassword:
175     type: string
176     hidden: true
177     default: ''  # Has to be here because of the ignored empty value bug
178   NeutronBridgeMappings:
179     description: >
180       The OVS logical->physical bridge mappings to use. See the Neutron
181       documentation for details. Defaults to mapping br-ex - the external
182       bridge on hosts - to a physical name 'datacentre' which can be used
183       to create provider networks (and we use this for the default floating
184       network) - if changing this either use different post-install network
185       scripts or be sure to keep 'datacentre' as a mapping network name.
186     type: string
187     default: ""
188   NeutronDnsmasqOptions:
189     default: 'dhcp-option-force=26,1400'
190     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.
191     type: string
192   NeutronEnableTunnelling:
193     type: string
194     default: "True"
195   NeutronFlatNetworks:
196     type: string
197     default: ''
198     description: If set, flat networks to configure in neutron plugins.
199   NeutronNetworkType:
200     default: 'gre'
201     description: The tenant network type for Neutron, either gre or vxlan.
202     type: string
203   NeutronNetworkVLANRanges:
204     default: 'datacentre'
205     description: >
206       The Neutron ML2 and OpenVSwitch vlan mapping range to support. See the
207       Neutron documentation for permitted values. Defaults to permitting any
208       VLAN on the 'datacentre' physical network (See NeutronBridgeMappings).
209     type: string
210   NeutronPassword:
211     default: unset
212     description: The password for the neutron service account, used by neutron agents.
213     type: string
214     hidden: true
215   NeutronPublicInterface:
216     default: eth0
217     description: What interface to bridge onto br-ex for network nodes.
218     type: string
219   NeutronPublicInterfaceTag:
220     default: ''
221     description: >
222       VLAN tag for creating a public VLAN. The tag will be used to
223       create an access port on the exterior bridge for each control plane node,
224       and that port will be given the IP address returned by neutron from the
225       public network. Set CONTROLEXTRA=overcloud-vlan-port.yaml when compiling
226       overcloud.yaml to include the deployment of VLAN ports to the control
227       plane.
228     type: string
229   NeutronPublicInterfaceDefaultRoute:
230     default: ''
231     description: A custom default route for the NeutronPublicInterface.
232     type: string
233   NeutronPublicInterfaceIP:
234     default: ''
235     description: A custom IP address to put onto the NeutronPublicInterface.
236     type: string
237   NeutronPublicInterfaceRawDevice:
238     default: ''
239     description: If set, the public interface is a vlan with this device as the raw device.
240     type: string
241   NeutronTunnelTypes:
242     default: 'gre'
243     description: |
244         The tunnel types for the Neutron tenant network. To specify multiple
245         values, use a comma separated string, like so: 'gre,vxlan'
246     type: string
247   NovaPassword:
248     default: unset
249     description: The password for the nova service account, used by nova-api.
250     type: string
251     hidden: true
252   NtpServer:
253     type: string
254     default: ''
255   PublicVirtualInterface:
256     default: 'br-ex'
257     description: >
258         Specifies the interface where the public-facing virtual ip will be assigned.
259         This should be int_public when a VLAN is being used.
260     type: string
261   PublicVirtualIP:
262     type: string
263     default: ''  # Has to be here because of the ignored empty value bug
264   RabbitCookie:
265     type: string
266     default: ''  # Has to be here because of the ignored empty value bug
267     hidden: true
268   RabbitPassword:
269     default: guest
270     description: The password for RabbitMQ
271     type: string
272     hidden: true
273   RabbitUserName:
274     default: guest
275     description: The username for RabbitMQ
276     type: string
277   SnmpdReadonlyUserName:
278     default: ro_snmp_user
279     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
280     type: string
281   SnmpdReadonlyUserPassword:
282     default: unset
283     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
284     type: string
285     hidden: true
286   SSLCACertificate:
287     default: ''
288     description: If set, the contents of an SSL certificate authority file.
289     type: string
290   SSLCertificate:
291     default: ''
292     description: If set, the contents of an SSL certificate .crt file for encrypting SSL endpoints.
293     type: string
294     hidden: true
295   SSLKey:
296     default: ''
297     description: If set, the contents of an SSL certificate .key file for encrypting SSL endpoints.
298     type: string
299     hidden: true
300   VirtualIP:
301     type: string
302     default: ''  # Has to be here because of the ignored empty value bug
303
304
305 resources:
306
307   Controller:
308     type: OS::Nova::Server
309     properties:
310       image: {get_param: Image}
311       image_update_policy: {get_param: ImageUpdatePolicy}
312       flavor: {get_param: Flavor}
313       key_name: {get_param: KeyName}
314       networks:
315         - network: ctlplane
316       user_data_format: SOFTWARE_CONFIG
317
318   ControllerConfig:
319     type: OS::Heat::StructuredConfig
320     properties:
321       group: os-apply-config
322       config:
323         admin-password: {get_param: AdminPassword}
324         admin-token: {get_param: AdminToken}
325         bootstack:
326           public_interface_ip: {get_param: NeutronPublicInterfaceIP}
327         bootstrap_host:
328           nodeid: {get_input: bootstack_nodeid}
329         database:
330           host: &database_host
331             {get_param: VirtualIP}
332         cinder:
333           db:
334             list_join:
335               - ''
336               - - mysql://cinder:unset@
337                 - *database_host
338                 - /cinder
339           debug: {get_param: Debug}
340           volume_size_mb: {get_param: CinderLVMLoopDeviceSize}
341           service-password: {get_param: CinderPassword}
342           iscsi-helper: {get_param: CinderISCSIHelper}
343         controller-address: {get_input: controller_host}
344         corosync:
345           bindnetaddr: {get_input: controller_host}
346           mcastport: 5577
347         pacemaker:
348           stonith_enabled : false
349           recheck_interval : 5
350           quorum_policy : ignore
351         db-password: unset
352         glance:
353           registry:
354             host: {get_input: controller_virtual_ip}
355           backend: swift
356           db:
357             list_join:
358               - ''
359               - - mysql://glance:unset@
360                 - *database_host
361                 - /glance
362           debug: {get_param: Debug}
363           host: {get_input: controller_virtual_ip}
364           port: {get_param: GlancePort}
365           protocol: {get_param: GlanceProtocol}
366           service-password: {get_param: GlancePassword}
367           swift-store-user: service:glance
368           swift-store-key: {get_param: GlancePassword}
369           notifier-strategy: {get_param: GlanceNotifierStrategy}
370           log-file: {get_param: GlanceLogFile}
371         heat:
372           admin_password: {get_param: HeatPassword}
373           admin_tenant_name: service
374           admin_user: heat
375           auth_encryption_key: unset___________
376           db:
377             list_join:
378               - ''
379               - - mysql://heat:unset@
380                 - *database_host
381                 - /heat
382           debug: {get_param: Debug}
383           stack_domain_admin_password: {get_param: HeatStackDomainAdminPassword}
384           watch_server_url: {get_input: heat.watch_server_url}
385           metadata_server_url: {get_input: heat.metadata_server_url}
386           waitcondition_server_url: {get_input: heat.waitcondition_server_url}
387         keystone:
388           db:
389             list_join:
390               - ''
391               - - mysql://keystone:unset@
392                 - *database_host
393                 - /keystone
394           debug: {get_param: Debug}
395           host: {get_input: controller_virtual_ip}
396           ca_certificate: {get_param: KeystoneCACertificate}
397           signing_key: {get_param: KeystoneSigningKey}
398           signing_certificate: {get_param: KeystoneSigningCertificate}
399         mysql:
400           innodb_buffer_pool_size: {get_param: MysqlInnodbBufferPoolSize}
401           local_bind: true
402           root-password: {get_param: MysqlRootPassword}
403           cluster_name:
404             str_replace:
405               template: tripleo-CLUSTER
406               params:
407                 CLUSTER: {get_param: MysqlClusterUniquePart}
408         neutron:
409           debug: {get_param: Debug}
410           flat-networks: {get_param: NeutronFlatNetworks}
411           host: {get_input: controller_virtual_ip}
412           metadata_proxy_shared_secret: unset
413           ovs:
414             enable_tunneling: {get_input: neutron_enable_tunneling}
415             local_ip: {get_input: controller_host}
416             network_vlan_ranges: {get_param: NeutronNetworkVLANRanges}
417             bridge_mappings: {get_param: NeutronBridgeMappings}
418             public_interface: {get_param: NeutronPublicInterface}
419             public_interface_raw_device: {get_param: NeutronPublicInterfaceRawDevice}
420             public_interface_route: {get_param: NeutronPublicInterfaceDefaultRoute}
421             public_interface_tag: {get_param: NeutronPublicInterfaceTag}
422             physical_bridge: br-ex
423             tenant_network_type: {get_param: NeutronNetworkType}
424             tunnel_types: {get_param: NeutronTunnelTypes}
425           ovs_db:
426             list_join:
427               - ''
428               - - mysql://neutron:unset@
429                 - *database_host
430                 - /ovs_neutron?charset=utf8
431           service-password: {get_param: NeutronPassword}
432           dnsmasq-options: {get_param: NeutronDnsmasqOptions}
433         ceilometer:
434           db:
435             list_join:
436               - ''
437               - - mysql://ceilometer:unset@
438                 - *database_host
439                 - /ceilometer
440           debug: {get_param: Debug}
441           metering_secret: {get_param: CeilometerMeteringSecret}
442           service-password: {get_param: CeilometerPassword}
443         snmpd:
444           export_MIB: UCD-SNMP-MIB
445           readonly_user_name: {get_param: SnmpdReadonlyUserName}
446           readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
447         nova:
448           compute_driver: libvirt.LibvirtDriver
449           db:
450             list_join:
451               - ''
452               - - mysql://nova:unset@
453                 - *database_host
454                 - /nova
455           default_floating_pool:
456             ext-net
457           host: {get_input: controller_virtual_ip}
458           metadata-proxy: true
459           service-password: {get_param: NovaPassword}
460         rabbit:
461           host: {get_input: controller_virtual_ip}
462           username: {get_param: RabbitUserName}
463           password: {get_param: RabbitPassword}
464           cookie: {get_param: RabbitCookie}
465         ntp:
466           servers:
467               - {server: {get_param: NtpServer}, fudge: "stratum 0"}
468         virtual_interfaces:
469           instances:
470             - vrrp_instance_name: VI_CONTROL
471               virtual_router_id: 51
472               keepalive_interface: {get_param: ControlVirtualInterface}
473               priority: 101
474               virtual_ips:
475               - ip: {get_param: VirtualIP}
476                 interface: {get_param: ControlVirtualInterface}
477             - vrrp_instance_name: VI_PUBLIC
478               virtual_router_id: 52
479               keepalive_interface: {get_param: PublicVirtualInterface}
480               priority: 101
481               virtual_ips:
482               - ip: {get_param: PublicVirtualIP}
483                 interface: {get_param: PublicVirtualInterface}
484           vrrp_sync_groups:
485             - name: VG1
486               members:
487                 - VI_CONTROL
488                 - VI_PUBLIC
489         keepalived:
490           keepalive_interface: {get_param: PublicVirtualInterface}
491           priority: 101
492         virtual_ips:
493             -
494               ip: {get_param: VirtualIP}
495               interface: {get_param: ControlVirtualInterface}
496             -
497               ip: {get_param: PublicVirtualIP}
498               interface: {get_param: PublicVirtualInterface}
499         haproxy:
500           net_binds:
501             - ip: {get_param: VirtualIP}
502           services:
503             - name: keystone_admin
504               port: 35357
505               net_binds: &public_binds
506                 - ip: {get_param: VirtualIP}
507                 - ip: {get_param: PublicVirtualIP}
508             - name: keystone_public
509               port: 5000
510               net_binds: *public_binds
511             - name: horizon
512               port: 80
513               net_binds: *public_binds
514             - name: neutron
515               port: 9696
516               net_binds: *public_binds
517             - name: cinder
518               port: 8776
519               net_binds: *public_binds
520             - name: glance_api
521               port: 9292
522               net_binds: *public_binds
523             - name: glance_registry
524               port: 9191
525               net_binds: *public_binds
526             - name: heat_api
527               port: 8004
528               net_binds: *public_binds
529             - name: heat_cloudwatch
530               port: 8003
531               net_binds: *public_binds
532             - name: heat_cfn
533               port: 8000
534               net_binds: *public_binds
535             - name: mysql
536               port: 3306
537               extra_server_params:
538                 - backup
539               options:
540                 - timeout client 0
541                 - timeout server 0
542             - name: nova_ec2
543               port: 8773
544             - name: nova_osapi
545               port: 8774
546               net_binds: *public_binds
547             - name: nova_metadata
548               port: 8775
549               net_binds: *public_binds
550             - name: ceilometer
551               port: 8777
552               net_binds: *public_binds
553             - name: swift_proxy_server
554               port: 8080
555               net_binds: *public_binds
556             - name: rabbitmq
557               port: 5672
558               options:
559                 - timeout client 0
560                 - timeout server 0
561
562   ControllerPassthroughConfig:
563     type: OS::Heat::StructuredConfig
564     properties:
565       group: os-apply-config
566       config: {get_input: passthrough_config}
567
568   ControllerPassthroughConfigSpecific:
569     type: OS::Heat::StructuredConfig
570     properties:
571       group: os-apply-config
572       config: {get_input: passthrough_config_specific}
573
574   ControllerDeployment:
575     type: OS::Heat::StructuredDeployment
576     properties:
577       signal_transport: NO_SIGNAL
578       config: {get_resource: ControllerConfig}
579       server: {get_resource: Controller}
580       input_values:
581         bootstack_nodeid: {get_attr: [Controller, name]}
582         controller_host: {get_attr: [Controller, networks, ctlplane, 0]}
583         controller_virtual_ip: {get_param: VirtualIP}
584         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
585         heat.watch_server_url:
586           list_join:
587             - ''
588             - - 'http://'
589               - {get_param: VirtualIP}
590               - ':8003'
591         heat.metadata_server_url:
592           list_join:
593             - ''
594             - - 'http://'
595               - {get_param: VirtualIP}
596               - ':8000'
597         heat.waitcondition_server_url:
598           list_join:
599             - ''
600             - - 'http://'
601               - {get_param: VirtualIP}
602               - ':8000/v1/waitcondition'
603
604   SSLConfig:
605     type: OS::Heat::StructuredConfig
606     properties:
607       group: os-apply-config
608       config:
609         ssl:
610           ca_certificate: {get_input: ssl_ca_certificate}
611         stunnel:
612           cert: {get_input: ssl_certificate}
613           key: {get_input: ssl_key}
614           cacert: {get_input: ssl_ca_certificate}
615           ports:
616            - name: 'ec2'
617              accept: 13773
618              connect: 8773
619              connect_host: {get_input: controller_host}
620            - name: 'image'
621              accept: 13292
622              connect: 9292
623              connect_host: {get_input: controller_host}
624            - name: 'identity'
625              accept: 13000
626              connect: 5000
627              connect_host: {get_input: controller_host}
628            - name: 'network'
629              accept: 13696
630              connect: 9696
631              connect_host: {get_input: controller_host}
632            - name: 'compute'
633              accept: 13774
634              connect: 8774
635              connect_host: {get_input: controller_host}
636            - name: 'swift-proxy'
637              accept: 13080
638              connect: 8080
639              connect_host: {get_input: controller_host}
640            - name: 'cinder'
641              accept: 13776
642              connect: 8776
643              connect_host: {get_input: controller_host}
644            - name: 'ceilometer'
645              accept: 13777
646              connect: 8777
647              connect_host: {get_input: controller_host}
648
649   ControllerSSLDeployment:
650     type: OS::Heat::StructuredDeployment
651     properties:
652       config: {get_resource: SSLConfig}
653       server: {get_resource: Controller}
654       signal_transport: NO_SIGNAL
655       input_values:
656         controller_host: {get_attr: [Controller, networks, ctlplane, 0]}
657         ssl_certificate: {get_param: SSLCertificate}
658         ssl_key: {get_param: SSLKey}
659         ssl_ca_certificate: {get_param: SSLCACertificate}
660
661   ControllerPassthroughDeployment:
662     type: OS::Heat::StructuredDeployment
663     properties:
664       config: {get_resource: ControllerPassthroughConfig}
665       server: {get_resource: Controller}
666       signal_transport: NO_SIGNAL
667       input_values:
668         passthrough_config: {get_param: ExtraConfig}
669
670   ControllerPassthroughSpecificDeployment:
671     depends_on: [ControllerPassthroughDeployment]
672     type: OS::Heat::StructuredDeployment
673     properties:
674       config: {get_resource: ControllerPassthroughConfigSpecific}
675       server: {get_resource: Controller}
676       signal_transport: NO_SIGNAL
677       input_values:
678         passthrough_config_specific: {get_param: ControllerExtraConfig}
679
680
681 outputs:
682   ip_address:
683     description: IP address of the server in the ctlplane network
684     value: {get_attr: [Controller, networks, ctlplane, 0]}
685   hostname:
686     description: Hostname of the server
687     value: {get_attr: [Controller, name]}
688   corosync_node:
689     description: >
690       Node object in the format {ip: ..., name: ...} format that the corosync
691       element expects
692     value:
693       ip: {get_attr: [Controller, networks, ctlplane, 0]}
694       name: {get_attr: [Controller, name]}
695   hosts_entry:
696     description: >
697       Server's IP address and hostname in the /etc/hosts format
698     value:
699       str_replace:
700         template: IP HOST HOST.novalocal CLOUDNAME
701         params:
702           IP: {get_attr: [Controller, networks, ctlplane, 0]}
703           HOST: {get_attr: [Controller, name]}
704           CLOUDNAME: {get_param: CloudName}
705   nova_server_resource:
706     description: Heat resource handle for the Nova compute server
707     value:
708       {get_resource: Controller}
709   swift_device:
710     description: Swift device formatted for swift-ring-builder
711     value:
712       str_replace:
713         template: 'r1z1-IP:%PORT%/d1'
714         params:
715           IP: {get_attr: [Controller, networks, ctlplane, 0]}
716   swift_proxy_memcache:
717     description: Swift proxy-memcache value
718     value:
719       str_replace:
720         template: "IP:11211"
721         params:
722           IP: {get_attr: [Controller, networks, ctlplane, 0]}