blob: 1af557ebd17641dde873eb2f56100b2d685cc0c3 [file] [log] [blame]
Mateusz Lose2ad0772020-02-27 21:41:54 +01001heat_template_version: queens
2
3parameters:
4
5 metadata:
6 type: json
7 default: {}
8 node_type:
9 type: string
10 key_name:
11 type: string
12 description: Name of keypair to assign to servers
13 image:
14 type: string
15 description: Name of image to use for servers
16 flavor:
17 type: string
18 description: Flavor to use for servers
19 accessible_network:
20 type: string
21 accessible_subnet_id:
22 type: string
23 private_floating_network:
24 type: string
25 private_floating_network_cidr:
26 type: string
27 private_floating_subnet_id:
28 type: string
29 private_floating_interface:
30 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020031 storage_backend_network_cidr:
32 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010033 storage_backend_network:
34 type: string
35 storage_backend_subnet_id:
36 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020037 storage_backend_interface:
38 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010039 storage_frontend_network:
40 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020041 storage_frontend_network_cidr:
42 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010043 storage_frontend_subnet_id:
44 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020045 storage_frontend_interface:
46 type: string
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020047 control_network_cidr:
Mateusz Lose2ad0772020-02-27 21:41:54 +010048 type: string
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030049 ironic_baremetal_network:
50 type: string
51 ironic_baremetal_subnet_id:
52 type: string
Vasyl Saienko4c468192020-05-19 11:51:13 +030053 ironic_baremetal_network_cidr:
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030054 type: string
Michael Polenchuk486cadf2020-08-24 16:25:51 +040055 ironic_baremetal_tunnel_cidr:
56 type: string
57 ironic_mt_enabled:
58 type: boolean
Anton Samoylovea0b23e2020-06-26 14:17:51 +040059 tungstenfabric_enabled:
60 type: boolean
61 tf_data_network:
62 type: string
63 tf_data_subnet_id:
64 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010065 functions_override:
66 type: string
67 boot_timeout:
68 type: number
69 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020070 default: 3600
Mateusz Lose2ad0772020-02-27 21:41:54 +010071 ucp_master_host:
72 type: string
73 default: ''
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030074 docker_ucp_image:
75 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010076 public_net_id:
77 type: string
78 docker_ee_release:
79 type: string
80 docker_ee_url:
81 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020082 hardware_metadata:
83 description: The content of lab metadata.
84 type: string
Oleh Hryhorov33e30e22020-03-12 11:51:40 +020085 user_data_config:
86 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
87 type: string
88 default: |
89 #cloud-config
90 #
91 # Don't mount ephemeral0 to /mnt as it's by default
92 mounts:
93 - [ ephemeral0, null ]
Mykyta Karpin6a153c52020-11-03 15:21:38 +020094 huge_pages:
95 description: >
96 String formatted as '<Number of Gb for 1Gb huge pages>,<Number of Mb for 2Mb huge pages'
97 If number is equal to 0 alloacation of huge pages won't be configured.
98 default: '0,0'
99 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +0100100
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400101conditions:
102 create_tf_data_network_res:
103 get_param: tungstenfabric_enabled
104
Mateusz Lose2ad0772020-02-27 21:41:54 +0100105resources:
106
107 software_config:
108 type: OS::Heat::SoftwareConfig
109 properties:
110 group: ungrouped
111 config:
112 str_replace:
113 template: { get_file: ../scripts/instance_boot.sh }
114 params:
115 $node_type: { get_param: node_type }
116 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100117 $docker_ee_url: { get_param: docker_ee_url }
118 $docker_ee_release: { get_param: docker_ee_release }
119 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300120 $docker_ucp_image: { get_param: docker_ucp_image }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100121 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200122 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100123 $private_floating_interface: { get_param: private_floating_interface }
124 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
125 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
126 $functions_override: { get_param: functions_override }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200127 $storage_frontend_interface: { get_param: storage_frontend_interface }
128 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
129 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
130 $storage_backend_interface: { get_param: storage_backend_interface }
131 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
132 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300133 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300134 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400135 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
136 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Mykyta Karpin6a153c52020-11-03 15:21:38 +0200137 $huge_pages: { get_param: huge_pages }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100138
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200139 inject_files:
140 type: "OS::Heat::CloudConfig"
141 properties:
142 cloud_config:
143 write_files:
144 - path: /usr/sbin/prepare-metadata.py
145 owner: "root:root"
146 permissions: "0755"
147 content: {get_file: ../scripts/prepare-metadata.py}
148 - path: /usr/share/metadata/lab-metadata.yaml
149 owner: "root:root"
150 permissions: "0644"
151 content: { get_param: hardware_metadata}
152
153 install_config_agent:
154 type: "OS::Heat::MultipartMime"
155 properties:
156 parts:
157 - config: {get_resource: software_config}
158 - config: {get_resource: inject_files}
Oleh Hryhorov33e30e22020-03-12 11:51:40 +0200159 - config: {get_param: user_data_config}
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200160
Mateusz Lose2ad0772020-02-27 21:41:54 +0100161 server:
162 type: OS::Nova::Server
163 properties:
164 image: { get_param: image }
165 flavor: { get_param: flavor }
166 key_name: { get_param: key_name }
167 availability_zone: nova
168 networks:
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400169 if:
170 - "create_tf_data_network_res"
171 - - port: { get_resource: accessible_server_port }
172 - port: { get_resource: private_floating_server_port }
173 - port: { get_resource: storage_frontend_server_port }
174 - port: { get_resource: storage_backend_server_port }
175 - port: { get_resource: ironic_baremetal_server_port }
176 - port: { get_resource: tf_data_server_port }
177 - - port: { get_resource: accessible_server_port }
178 - port: { get_resource: private_floating_server_port }
179 - port: { get_resource: storage_frontend_server_port }
180 - port: { get_resource: storage_backend_server_port }
181 - port: { get_resource: ironic_baremetal_server_port }
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200182 user_data_format: SOFTWARE_CONFIG
183 user_data: { get_resource: install_config_agent}
Mateusz Lose2ad0772020-02-27 21:41:54 +0100184 metadata: { get_param: metadata }
185
186 accessible_server_port:
187 type: OS::Neutron::Port
188 properties:
189 network_id: { get_param: accessible_network }
190 port_security_enabled: false
191 fixed_ips:
192 - subnet: { get_param: accessible_subnet_id }
193
194 storage_backend_server_port:
195 type: OS::Neutron::Port
196 properties:
197 network_id: { get_param: storage_backend_network }
198 port_security_enabled: false
199 fixed_ips:
200 - subnet: { get_param: storage_backend_subnet_id }
201
202 storage_frontend_server_port:
203 type: OS::Neutron::Port
204 properties:
205 network_id: { get_param: storage_frontend_network }
206 port_security_enabled: false
207 fixed_ips:
208 - subnet: { get_param: storage_frontend_subnet_id }
209
210 private_floating_server_port:
211 type: OS::Neutron::Port
212 properties:
213 network_id: { get_param: private_floating_network }
214 port_security_enabled: false
215 fixed_ips:
216 - subnet: { get_param: private_floating_subnet_id }
217
218 server_floating_ip:
219 type: OS::Neutron::FloatingIP
220 properties:
221 floating_network_id: { get_param: public_net_id }
222 port_id: { get_resource: accessible_server_port }
223
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300224 ironic_baremetal_server_port:
225 type: OS::Neutron::Port
226 properties:
227 network_id: { get_param: ironic_baremetal_network }
228 port_security_enabled: false
229 fixed_ips:
230 - subnet: { get_param: ironic_baremetal_subnet_id }
231
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400232 tf_data_server_port:
233 type: OS::Neutron::Port
234 condition: create_tf_data_network_res
235 properties:
236 network_id: { get_param: tf_data_network }
237 port_security_enabled: false
238 fixed_ips:
239 - subnet: { get_param: tf_data_subnet_id }
240
Mateusz Lose2ad0772020-02-27 21:41:54 +0100241 wait_handle:
242 type: OS::Heat::WaitConditionHandle
243 wait_condition:
244 type: OS::Heat::WaitCondition
245 properties:
246 handle: { get_resource: wait_handle }
247 timeout: { get_param: boot_timeout }
248
249outputs:
250 server_private_ip:
251 description: IP address of server in private network
252 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
253 server_private_floating_ip:
254 description: IP address of server in private floating network
255 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300256 server_ironic_baremetal_ip:
257 description: IP address of server in ironic baremetal network
258 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400259 server_tf_data_ip:
260 description: IP address of server in tf data network
261 value: { get_attr: [tf_data_server_port, fixed_ips, 0, ip_address] }
262 condition: create_tf_data_network_res
Mateusz Lose2ad0772020-02-27 21:41:54 +0100263 server_public_ip:
264 description: Floating IP address of server in public network
265 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200266 wc_data:
267 description: Metadata from instance
268 value: { get_attr: [wait_condition, data]}