Merge "Output internal API VIPs"
[apex-tripleo-heat-templates.git] / cinder-storage.yaml
1 heat_template_version: 2015-04-30
2 description: 'Common Block Storage Configuration'
3 parameters:
4   Image:
5     default: overcloud-cinder-volume
6     type: string
7   CinderEnableIscsiBackend:
8     default: true
9     description: Whether to enable or not the Iscsi backend for Cinder
10     type: boolean
11   CinderISCSIHelper:
12     default: tgtadm
13     description: The iSCSI helper to use with cinder.
14     type: string
15   CinderLVMLoopDeviceSize:
16     default: 5000
17     description: The size of the loopback file used by the cinder LVM driver.
18     type: number
19   CinderPassword:
20     default: unset
21     description: The password for the cinder service and db account, used by cinder-api.
22     type: string
23     hidden: true
24   VirtualIP:
25     default: ''
26     type: string
27   ExtraConfig:
28     default: {}
29     description: |
30       Additional configuration to inject into the cluster. The JSON should have
31       the following structure:
32         {"FILEKEY":
33           {"config":
34             [{"section": "SECTIONNAME",
35               "values":
36                 [{"option": "OPTIONNAME",
37                   "value": "VALUENAME"
38                  }
39                 ]
40              }
41             ]
42           }
43         }
44       For instance:
45         {"nova":
46           {"config":
47             [{"section": "default",
48               "values":
49                 [{"option": "force_config_drive",
50                   "value": "always"
51                  }
52                 ]
53              },
54              {"section": "cells",
55               "values":
56                 [{"option": "driver",
57                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
58                  }
59                 ]
60              }
61             ]
62           }
63         }
64     type: json
65   Flavor:
66     description: Flavor for block storage nodes to request when deploying.
67     type: string
68     constraints:
69       - custom_constraint: nova.flavor
70   GlancePort:
71     default: "9292"
72     description: Glance port.
73     type: string
74   GlanceProtocol:
75     default: http
76     description: Protocol to use when connecting to glance, set to https for SSL.
77     type: string
78   KeyName:
79     default: default
80     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
81     type: string
82   RabbitPassword:
83     default: 'guest'
84     type: string
85   RabbitUserName:
86     default: 'guest'
87     type: string
88   RabbitClientUseSSL:
89     default: false
90     description: >
91         Rabbit client subscriber parameter to specify
92         an SSL connection to the RabbitMQ host.
93     type: string
94   RabbitClientPort:
95     default: 5672
96     description: Set rabbit subscriber port, change this if using SSL
97     type: number
98   SnmpdReadonlyUserName:
99     default: ro_snmp_user
100     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
101     type: string
102   SnmpdReadonlyUserPassword:
103     default: unset
104     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
105     type: string
106     hidden: true
107   UpdateIdentifier:
108     default: ''
109     type: string
110     description: >
111       Setting to a previously unused value during stack-update will trigger
112       package update on all nodes
113   Hostname:
114     type: string
115     default: '' # Defaults to Heat created hostname
116   ServiceNetMap:
117     default: {}
118     description: Mapping of service_name -> network name. Typically set
119                  via parameter_defaults in the resource registry.
120     type: json
121   GlanceApiVirtualIP:
122     type: string
123     default: ''
124   MysqlVirtualIP:
125     type: string
126     default: ''
127
128 resources:
129   BlockStorage:
130     type: OS::Nova::Server
131     properties:
132       image:
133         {get_param: Image}
134       flavor: {get_param: Flavor}
135       key_name: {get_param: KeyName}
136       networks:
137         - network: ctlplane
138       user_data_format: SOFTWARE_CONFIG
139       user_data: {get_resource: NodeUserData}
140       name: {get_param: Hostname}
141
142   NodeUserData:
143     type: OS::TripleO::NodeUserData
144
145   InternalApiPort:
146     type: OS::TripleO::BlockStorage::Ports::InternalApiPort
147     properties:
148       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
149
150   StoragePort:
151     type: OS::TripleO::BlockStorage::Ports::StoragePort
152     properties:
153       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
154
155   StorageMgmtPort:
156     type: OS::TripleO::BlockStorage::Ports::StorageMgmtPort
157     properties:
158       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
159
160   NetworkConfig:
161     type: OS::TripleO::BlockStorage::Net::SoftwareConfig
162     properties:
163       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
164       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
165       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
166
167   NetworkDeployment:
168     type: OS::TripleO::SoftwareDeployment
169     properties:
170       config: {get_resource: NetworkConfig}
171       server: {get_resource: BlockStorage}
172
173   BlockStorageDeployment:
174     type: OS::Heat::StructuredDeployment
175     properties:
176       server: {get_resource: BlockStorage}
177       config: {get_resource: BlockStorageConfig}
178       input_values:
179         controller_virtual_ip: {get_param: VirtualIP}
180         cinder_dsn: {list_join: ['', ['mysql://cinder:', {get_param: CinderPassword}, '@', {get_param: VirtualIP} , '/cinder']]}
181         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
182         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
183       signal_transport: NO_SIGNAL
184   BlockStorageConfig:
185     type: OS::Heat::StructuredConfig
186     properties:
187       group: os-apply-config
188       config:
189         keystone:
190           host: {get_input: controller_virtual_ip}
191         cinder:
192           db: {get_input: cinder_dsn}
193           volume_size_mb:
194             get_param: CinderLVMLoopDeviceSize
195           iscsi-helper:
196             get_param: CinderISCSIHelper
197         snmpd:
198           export_MIB: UCD-SNMP-MIB
199           readonly_user_name: {get_input: snmpd_readonly_user_name}
200           readonly_user_password: {get_input: snmpd_readonly_user_password}
201         rabbit:
202           host: {get_input: controller_virtual_ip}
203           username: {get_param: RabbitUserName}
204           password: {get_param: RabbitPassword}
205         glance:
206           host: {get_input: controller_virtual_ip}
207           port: {get_param: GlancePort}
208 outputs:
209   hosts_entry:
210     value:
211       str_replace:
212         template: "IP HOST"
213         params:
214           IP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
215           HOST: {get_attr: [BlockStorage, name]}
216   internal_api_ip_address:
217     description: IP address of the server in the internal_api network
218     value: {get_attr: [InternalApiPort, ip_address]}
219   storage_ip_address:
220     description: IP address of the server in the storage network
221     value: {get_attr: [StoragePort, ip_address]}
222   storage_mgmt_ip_address:
223     description: IP address of the server in the storage_mgmt network
224     value: {get_attr: [StorageMgmtPort, ip_address]}
225   config_identifier:
226     description: identifier which changes if the node configuration may need re-applying
227     value: "None - NO_SIGNAL"