Merge "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   SwiftHashSuffix:
301     default: unset
302     description: A random string to be used as a salt when hashing to determine mappings
303       in the ring.
304     hidden: true
305     type: string
306   SwiftPartPower:
307     default: 10
308     description: Partition Power to use when building Swift rings
309     type: number
310   SwiftPassword:
311     default: unset
312     description: The password for the swift service account, used by the swift proxy
313       services.
314     hidden: true
315     type: string
316   SwiftReplicas:
317     type: number
318     default: 1
319     description: How many replicas to use in the swift rings.
320   VirtualIP:
321     type: string
322     default: ''  # Has to be here because of the ignored empty value bug
323
324
325 resources:
326
327   Controller:
328     type: OS::Nova::Server
329     properties:
330       image: {get_param: Image}
331       image_update_policy: {get_param: ImageUpdatePolicy}
332       flavor: {get_param: Flavor}
333       key_name: {get_param: KeyName}
334       networks:
335         - network: ctlplane
336       user_data_format: SOFTWARE_CONFIG
337
338   ControllerConfig:
339     type: OS::Heat::StructuredConfig
340     properties:
341       group: os-apply-config
342       config:
343         admin-password: {get_param: AdminPassword}
344         admin-token: {get_param: AdminToken}
345         bootstack:
346           public_interface_ip: {get_param: NeutronPublicInterfaceIP}
347         bootstrap_host:
348           nodeid: {get_input: bootstack_nodeid}
349         database:
350           host: &database_host
351             {get_param: VirtualIP}
352         cinder:
353           db:
354             list_join:
355               - ''
356               - - mysql://cinder:unset@
357                 - *database_host
358                 - /cinder
359           debug: {get_param: Debug}
360           volume_size_mb: {get_param: CinderLVMLoopDeviceSize}
361           service-password: {get_param: CinderPassword}
362           iscsi-helper: {get_param: CinderISCSIHelper}
363         controller-address: {get_input: controller_host}
364         corosync:
365           bindnetaddr: {get_input: controller_host}
366           mcastport: 5577
367         pacemaker:
368           stonith_enabled : false
369           recheck_interval : 5
370           quorum_policy : ignore
371         db-password: unset
372         glance:
373           registry:
374             host: {get_input: controller_virtual_ip}
375           backend: swift
376           db:
377             list_join:
378               - ''
379               - - mysql://glance:unset@
380                 - *database_host
381                 - /glance
382           debug: {get_param: Debug}
383           host: {get_input: controller_virtual_ip}
384           port: {get_param: GlancePort}
385           protocol: {get_param: GlanceProtocol}
386           service-password: {get_param: GlancePassword}
387           swift-store-user: service:glance
388           swift-store-key: {get_param: GlancePassword}
389           notifier-strategy: {get_param: GlanceNotifierStrategy}
390           log-file: {get_param: GlanceLogFile}
391         heat:
392           admin_password: {get_param: HeatPassword}
393           admin_tenant_name: service
394           admin_user: heat
395           auth_encryption_key: unset___________
396           db:
397             list_join:
398               - ''
399               - - mysql://heat:unset@
400                 - *database_host
401                 - /heat
402           debug: {get_param: Debug}
403           stack_domain_admin_password: {get_param: HeatStackDomainAdminPassword}
404           watch_server_url: {get_input: heat.watch_server_url}
405           metadata_server_url: {get_input: heat.metadata_server_url}
406           waitcondition_server_url: {get_input: heat.waitcondition_server_url}
407         keystone:
408           db:
409             list_join:
410               - ''
411               - - mysql://keystone:unset@
412                 - *database_host
413                 - /keystone
414           debug: {get_param: Debug}
415           host: {get_input: controller_virtual_ip}
416           ca_certificate: {get_param: KeystoneCACertificate}
417           signing_key: {get_param: KeystoneSigningKey}
418           signing_certificate: {get_param: KeystoneSigningCertificate}
419         mysql:
420           innodb_buffer_pool_size: {get_param: MysqlInnodbBufferPoolSize}
421           local_bind: true
422           root-password: {get_param: MysqlRootPassword}
423           cluster_name:
424             str_replace:
425               template: tripleo-CLUSTER
426               params:
427                 CLUSTER: {get_param: MysqlClusterUniquePart}
428         neutron:
429           debug: {get_param: Debug}
430           flat-networks: {get_param: NeutronFlatNetworks}
431           host: {get_input: controller_virtual_ip}
432           metadata_proxy_shared_secret: unset
433           ovs:
434             enable_tunneling: {get_input: neutron_enable_tunneling}
435             local_ip: {get_input: controller_host}
436             network_vlan_ranges: {get_param: NeutronNetworkVLANRanges}
437             bridge_mappings: {get_param: NeutronBridgeMappings}
438             public_interface: {get_param: NeutronPublicInterface}
439             public_interface_raw_device: {get_param: NeutronPublicInterfaceRawDevice}
440             public_interface_route: {get_param: NeutronPublicInterfaceDefaultRoute}
441             public_interface_tag: {get_param: NeutronPublicInterfaceTag}
442             physical_bridge: br-ex
443             tenant_network_type: {get_param: NeutronNetworkType}
444             tunnel_types: {get_param: NeutronTunnelTypes}
445           ovs_db:
446             list_join:
447               - ''
448               - - mysql://neutron:unset@
449                 - *database_host
450                 - /ovs_neutron?charset=utf8
451           service-password: {get_param: NeutronPassword}
452           dnsmasq-options: {get_param: NeutronDnsmasqOptions}
453         ceilometer:
454           db:
455             list_join:
456               - ''
457               - - mysql://ceilometer:unset@
458                 - *database_host
459                 - /ceilometer
460           debug: {get_param: Debug}
461           metering_secret: {get_param: CeilometerMeteringSecret}
462           service-password: {get_param: CeilometerPassword}
463         snmpd:
464           export_MIB: UCD-SNMP-MIB
465           readonly_user_name: {get_param: SnmpdReadonlyUserName}
466           readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
467         nova:
468           compute_driver: libvirt.LibvirtDriver
469           db:
470             list_join:
471               - ''
472               - - mysql://nova:unset@
473                 - *database_host
474                 - /nova
475           default_floating_pool:
476             ext-net
477           host: {get_input: controller_virtual_ip}
478           metadata-proxy: true
479           service-password: {get_param: NovaPassword}
480         rabbit:
481           host: {get_input: controller_virtual_ip}
482           username: {get_param: RabbitUserName}
483           password: {get_param: RabbitPassword}
484           cookie: {get_param: RabbitCookie}
485         ntp:
486           servers:
487               - {server: {get_param: NtpServer}, fudge: "stratum 0"}
488         virtual_interfaces:
489           instances:
490             - vrrp_instance_name: VI_CONTROL
491               virtual_router_id: 51
492               keepalive_interface: {get_param: ControlVirtualInterface}
493               priority: 101
494               virtual_ips:
495               - ip: {get_param: VirtualIP}
496                 interface: {get_param: ControlVirtualInterface}
497             - vrrp_instance_name: VI_PUBLIC
498               virtual_router_id: 52
499               keepalive_interface: {get_param: PublicVirtualInterface}
500               priority: 101
501               virtual_ips:
502               - ip: {get_param: PublicVirtualIP}
503                 interface: {get_param: PublicVirtualInterface}
504           vrrp_sync_groups:
505             - name: VG1
506               members:
507                 - VI_CONTROL
508                 - VI_PUBLIC
509         keepalived:
510           keepalive_interface: {get_param: PublicVirtualInterface}
511           priority: 101
512         virtual_ips:
513             -
514               ip: {get_param: VirtualIP}
515               interface: {get_param: ControlVirtualInterface}
516             -
517               ip: {get_param: PublicVirtualIP}
518               interface: {get_param: PublicVirtualInterface}
519         haproxy:
520           net_binds:
521             - ip: {get_param: VirtualIP}
522           services:
523             - name: keystone_admin
524               port: 35357
525               net_binds: &public_binds
526                 - ip: {get_param: VirtualIP}
527                 - ip: {get_param: PublicVirtualIP}
528             - name: keystone_public
529               port: 5000
530               net_binds: *public_binds
531             - name: horizon
532               port: 80
533               net_binds: *public_binds
534             - name: neutron
535               port: 9696
536               net_binds: *public_binds
537             - name: cinder
538               port: 8776
539               net_binds: *public_binds
540             - name: glance_api
541               port: 9292
542               net_binds: *public_binds
543             - name: glance_registry
544               port: 9191
545               net_binds: *public_binds
546             - name: heat_api
547               port: 8004
548               net_binds: *public_binds
549             - name: heat_cloudwatch
550               port: 8003
551               net_binds: *public_binds
552             - name: heat_cfn
553               port: 8000
554               net_binds: *public_binds
555             - name: mysql
556               port: 3306
557               extra_server_params:
558                 - backup
559               options:
560                 - timeout client 0
561                 - timeout server 0
562             - name: nova_ec2
563               port: 8773
564             - name: nova_osapi
565               port: 8774
566               net_binds: *public_binds
567             - name: nova_metadata
568               port: 8775
569               net_binds: *public_binds
570             - name: ceilometer
571               port: 8777
572               net_binds: *public_binds
573             - name: swift_proxy_server
574               port: 8080
575               net_binds: *public_binds
576             - name: rabbitmq
577               port: 5672
578               options:
579                 - timeout client 0
580                 - timeout server 0
581
582   ControllerPassthroughConfig:
583     type: OS::Heat::StructuredConfig
584     properties:
585       group: os-apply-config
586       config: {get_input: passthrough_config}
587
588   ControllerPassthroughConfigSpecific:
589     type: OS::Heat::StructuredConfig
590     properties:
591       group: os-apply-config
592       config: {get_input: passthrough_config_specific}
593
594   ControllerDeployment:
595     type: OS::Heat::StructuredDeployment
596     properties:
597       signal_transport: NO_SIGNAL
598       config: {get_resource: ControllerConfig}
599       server: {get_resource: Controller}
600       input_values:
601         bootstack_nodeid: {get_attr: [Controller, name]}
602         controller_host: {get_attr: [Controller, networks, ctlplane, 0]}
603         controller_virtual_ip: {get_param: VirtualIP}
604         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
605         heat.watch_server_url:
606           list_join:
607             - ''
608             - - 'http://'
609               - {get_param: VirtualIP}
610               - ':8003'
611         heat.metadata_server_url:
612           list_join:
613             - ''
614             - - 'http://'
615               - {get_param: VirtualIP}
616               - ':8000'
617         heat.waitcondition_server_url:
618           list_join:
619             - ''
620             - - 'http://'
621               - {get_param: VirtualIP}
622               - ':8000/v1/waitcondition'
623
624   SSLConfig:
625     type: OS::Heat::StructuredConfig
626     properties:
627       group: os-apply-config
628       config:
629         ssl:
630           ca_certificate: {get_input: ssl_ca_certificate}
631         stunnel:
632           cert: {get_input: ssl_certificate}
633           key: {get_input: ssl_key}
634           cacert: {get_input: ssl_ca_certificate}
635           ports:
636            - name: 'ec2'
637              accept: 13773
638              connect: 8773
639              connect_host: {get_input: controller_host}
640            - name: 'image'
641              accept: 13292
642              connect: 9292
643              connect_host: {get_input: controller_host}
644            - name: 'identity'
645              accept: 13000
646              connect: 5000
647              connect_host: {get_input: controller_host}
648            - name: 'network'
649              accept: 13696
650              connect: 9696
651              connect_host: {get_input: controller_host}
652            - name: 'compute'
653              accept: 13774
654              connect: 8774
655              connect_host: {get_input: controller_host}
656            - name: 'swift-proxy'
657              accept: 13080
658              connect: 8080
659              connect_host: {get_input: controller_host}
660            - name: 'cinder'
661              accept: 13776
662              connect: 8776
663              connect_host: {get_input: controller_host}
664            - name: 'ceilometer'
665              accept: 13777
666              connect: 8777
667              connect_host: {get_input: controller_host}
668
669   ControllerSSLDeployment:
670     type: OS::Heat::StructuredDeployment
671     properties:
672       config: {get_resource: SSLConfig}
673       server: {get_resource: Controller}
674       signal_transport: NO_SIGNAL
675       input_values:
676         controller_host: {get_attr: [Controller, networks, ctlplane, 0]}
677         ssl_certificate: {get_param: SSLCertificate}
678         ssl_key: {get_param: SSLKey}
679         ssl_ca_certificate: {get_param: SSLCACertificate}
680
681   ControllerPassthroughDeployment:
682     type: OS::Heat::StructuredDeployment
683     properties:
684       config: {get_resource: ControllerPassthroughConfig}
685       server: {get_resource: Controller}
686       signal_transport: NO_SIGNAL
687       input_values:
688         passthrough_config: {get_param: ExtraConfig}
689
690   ControllerPassthroughSpecificDeployment:
691     depends_on: [ControllerPassthroughDeployment]
692     type: OS::Heat::StructuredDeployment
693     properties:
694       config: {get_resource: ControllerPassthroughConfigSpecific}
695       server: {get_resource: Controller}
696       signal_transport: NO_SIGNAL
697       input_values:
698         passthrough_config_specific: {get_param: ControllerExtraConfig}
699
700   SwiftConfig:
701     type: OS::Heat::StructuredConfig
702     properties:
703       group: os-apply-config
704       config:
705         swift:
706           hash: { get_input: swift_hash_suffix }
707           part-power: { get_input: swift_part_power }
708           replicas: {get_input: swift_replicas }
709           service-password: { get_input: swift_password }
710
711   SwiftStorageDeploy:
712     type: OS::Heat::StructuredDeployment
713     properties:
714       server: {get_resource: Controller}
715       config: {get_resource: SwiftConfig}
716       signal_transport: NO_SIGNAL
717       input_values:
718         swift_hash_suffix: {get_param: SwiftHashSuffix}
719         swift_password: {get_param: SwiftPassword}
720         swift_part_power: {get_param: SwiftPartPower}
721         swift_replicas: { get_param: SwiftReplicas}
722
723 outputs:
724   ip_address:
725     description: IP address of the server in the ctlplane network
726     value: {get_attr: [Controller, networks, ctlplane, 0]}
727   hostname:
728     description: Hostname of the server
729     value: {get_attr: [Controller, name]}
730   corosync_node:
731     description: >
732       Node object in the format {ip: ..., name: ...} format that the corosync
733       element expects
734     value:
735       ip: {get_attr: [Controller, networks, ctlplane, 0]}
736       name: {get_attr: [Controller, name]}
737   hosts_entry:
738     description: >
739       Server's IP address and hostname in the /etc/hosts format
740     value:
741       str_replace:
742         template: IP HOST HOST.novalocal CLOUDNAME
743         params:
744           IP: {get_attr: [Controller, networks, ctlplane, 0]}
745           HOST: {get_attr: [Controller, name]}
746           CLOUDNAME: {get_param: CloudName}
747   nova_server_resource:
748     description: Heat resource handle for the Nova compute server
749     value:
750       {get_resource: Controller}
751   swift_device:
752     description: Swift device formatted for swift-ring-builder
753     value:
754       str_replace:
755         template: 'r1z1-IP:%PORT%/d1'
756         params:
757           IP: {get_attr: [Controller, networks, ctlplane, 0]}
758   swift_proxy_memcache:
759     description: Swift proxy-memcache value
760     value:
761       str_replace:
762         template: "IP:11211"
763         params:
764           IP: {get_attr: [Controller, networks, ctlplane, 0]}