blob: e5b4d9a3e83d4d49f67388eb98254dfeecc733ee [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
Vasyl Saienko8d34ad02021-07-26 11:55:23 +030010 kubernetes_installer:
11 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010012 key_name:
13 type: string
14 description: Name of keypair to assign to servers
15 image:
16 type: string
17 description: Name of image to use for servers
18 flavor:
19 type: string
20 description: Flavor to use for servers
21 accessible_network:
22 type: string
23 accessible_subnet_id:
24 type: string
25 private_floating_network:
26 type: string
27 private_floating_network_cidr:
28 type: string
29 private_floating_subnet_id:
30 type: string
31 private_floating_interface:
32 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020033 storage_backend_network_cidr:
34 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010035 storage_backend_network:
36 type: string
37 storage_backend_subnet_id:
38 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020039 storage_backend_interface:
40 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010041 storage_frontend_network:
42 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020043 storage_frontend_network_cidr:
44 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010045 storage_frontend_subnet_id:
46 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020047 storage_frontend_interface:
48 type: string
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020049 control_network_cidr:
Mateusz Lose2ad0772020-02-27 21:41:54 +010050 type: string
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030051 ironic_baremetal_network:
52 type: string
53 ironic_baremetal_subnet_id:
54 type: string
Vasyl Saienko4c468192020-05-19 11:51:13 +030055 ironic_baremetal_network_cidr:
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030056 type: string
Michael Polenchuk486cadf2020-08-24 16:25:51 +040057 ironic_baremetal_tunnel_cidr:
58 type: string
59 ironic_mt_enabled:
60 type: boolean
Anton Samoylovea0b23e2020-06-26 14:17:51 +040061 tungstenfabric_enabled:
62 type: boolean
Oleh Hryhorove7feab42020-11-11 18:00:29 +020063 tun_network:
Anton Samoylovea0b23e2020-06-26 14:17:51 +040064 type: string
Oleh Hryhorove7feab42020-11-11 18:00:29 +020065 tun_subnet_id:
Anton Samoylovea0b23e2020-06-26 14:17:51 +040066 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010067 functions_override:
68 type: string
69 boot_timeout:
70 type: number
71 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020072 default: 3600
Mateusz Lose2ad0772020-02-27 21:41:54 +010073 ucp_master_host:
74 type: string
75 default: ''
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030076 docker_ucp_image:
77 type: string
Stepan Rogov60bc3522020-12-16 17:43:25 +030078 docker_default_address_pool:
79 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010080 public_net_id:
81 type: string
82 docker_ee_release:
83 type: string
84 docker_ee_url:
85 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020086 hardware_metadata:
87 description: The content of lab metadata.
88 type: string
Oleh Hryhorov33e30e22020-03-12 11:51:40 +020089 user_data_config:
90 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
91 type: string
92 default: |
93 #cloud-config
94 #
95 # Don't mount ephemeral0 to /mnt as it's by default
96 mounts:
97 - [ ephemeral0, null ]
Mykyta Karpin6a153c52020-11-03 15:21:38 +020098 huge_pages:
99 description: >
100 String formatted as '<Number of Gb for 1Gb huge pages>,<Number of Mb for 2Mb huge pages'
101 If number is equal to 0 alloacation of huge pages won't be configured.
102 default: '0,0'
103 type: string
Vasyl Saienko846c6342021-02-24 17:01:36 +0200104 frr_bgp_neighbors:
105 description: Comma separated list of IP of BGP neighbors
106 default: ''
107 type: string
Oleksii Grudev4e3c8b42021-03-02 19:02:45 +0200108 lvm_loop_device_size:
109 type: number
110 default: 0
Vasyl Saienkocd302062021-04-21 22:25:18 +0300111 cinder_lvm_loop_device_size:
112 type: number
113 default: 0
Denis Egorenkoe09856a2021-11-01 13:52:46 +0400114 num_volumes:
115 type: number
116 default: 0
Mateusz Lose2ad0772020-02-27 21:41:54 +0100117
118resources:
119
120 software_config:
121 type: OS::Heat::SoftwareConfig
122 properties:
123 group: ungrouped
124 config:
125 str_replace:
126 template: { get_file: ../scripts/instance_boot.sh }
127 params:
128 $node_type: { get_param: node_type }
Vasyl Saienko8d34ad02021-07-26 11:55:23 +0300129 $kubernetes_installer: { get_param: kubernetes_installer }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100130 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100131 $docker_ee_url: { get_param: docker_ee_url }
132 $docker_ee_release: { get_param: docker_ee_release }
133 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300134 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300135 $docker_default_address_pool: { get_param: docker_default_address_pool }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100136 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200137 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100138 $private_floating_interface: { get_param: private_floating_interface }
139 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
140 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
141 $functions_override: { get_param: functions_override }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200142 $storage_frontend_interface: { get_param: storage_frontend_interface }
143 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
144 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
145 $storage_backend_interface: { get_param: storage_backend_interface }
146 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
147 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300148 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300149 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400150 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
Vasyl Saienko3dd0c272020-11-16 17:20:07 +0200151 $tunnel_interface_ip: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400152 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Mykyta Karpin6a153c52020-11-03 15:21:38 +0200153 $huge_pages: { get_param: huge_pages }
Anton Samoylovec019d52020-11-19 18:55:47 +0400154 $tungstenfabric_enabled: { get_param: tungstenfabric_enabled }
Vasyl Saienko846c6342021-02-24 17:01:36 +0200155 $frr_bgp_neighbors: { get_param: frr_bgp_neighbors }
Oleksii Grudev4e3c8b42021-03-02 19:02:45 +0200156 $lvm_loop_device_size: { get_param: lvm_loop_device_size }
Vasyl Saienkocd302062021-04-21 22:25:18 +0300157 $cinder_lvm_loop_device_size: { get_param: cinder_lvm_loop_device_size }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100158
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200159 inject_files:
160 type: "OS::Heat::CloudConfig"
161 properties:
162 cloud_config:
163 write_files:
164 - path: /usr/sbin/prepare-metadata.py
165 owner: "root:root"
166 permissions: "0755"
167 content: {get_file: ../scripts/prepare-metadata.py}
168 - path: /usr/share/metadata/lab-metadata.yaml
169 owner: "root:root"
170 permissions: "0644"
171 content: { get_param: hardware_metadata}
172
173 install_config_agent:
174 type: "OS::Heat::MultipartMime"
175 properties:
176 parts:
177 - config: {get_resource: software_config}
178 - config: {get_resource: inject_files}
Oleh Hryhorov33e30e22020-03-12 11:51:40 +0200179 - config: {get_param: user_data_config}
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200180
Mateusz Lose2ad0772020-02-27 21:41:54 +0100181 server:
182 type: OS::Nova::Server
183 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200184 config_drive: true
Mateusz Lose2ad0772020-02-27 21:41:54 +0100185 image: { get_param: image }
186 flavor: { get_param: flavor }
187 key_name: { get_param: key_name }
188 availability_zone: nova
189 networks:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200190 - port: { get_resource: accessible_server_port }
191 - port: { get_resource: private_floating_server_port }
192 - port: { get_resource: storage_frontend_server_port }
193 - port: { get_resource: storage_backend_server_port }
194 - port: { get_resource: ironic_baremetal_server_port }
195 - port: { get_resource: tun_server_port }
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200196 user_data_format: SOFTWARE_CONFIG
197 user_data: { get_resource: install_config_agent}
Mateusz Lose2ad0772020-02-27 21:41:54 +0100198 metadata: { get_param: metadata }
199
Denis Egorenkoe09856a2021-11-01 13:52:46 +0400200 extra_volumes:
201 type: OS::Heat::ResourceGroup
202 properties:
203 count: { get_param: num_volumes }
204 resource_def:
205 type: ./CinderVolumeVM.yaml
206 properties:
207 instance_id: { get_resource: server }
208
Mateusz Lose2ad0772020-02-27 21:41:54 +0100209 accessible_server_port:
210 type: OS::Neutron::Port
211 properties:
212 network_id: { get_param: accessible_network }
213 port_security_enabled: false
214 fixed_ips:
215 - subnet: { get_param: accessible_subnet_id }
216
217 storage_backend_server_port:
218 type: OS::Neutron::Port
219 properties:
220 network_id: { get_param: storage_backend_network }
221 port_security_enabled: false
222 fixed_ips:
223 - subnet: { get_param: storage_backend_subnet_id }
224
225 storage_frontend_server_port:
226 type: OS::Neutron::Port
227 properties:
228 network_id: { get_param: storage_frontend_network }
229 port_security_enabled: false
230 fixed_ips:
231 - subnet: { get_param: storage_frontend_subnet_id }
232
233 private_floating_server_port:
234 type: OS::Neutron::Port
235 properties:
236 network_id: { get_param: private_floating_network }
237 port_security_enabled: false
238 fixed_ips:
239 - subnet: { get_param: private_floating_subnet_id }
240
241 server_floating_ip:
242 type: OS::Neutron::FloatingIP
243 properties:
244 floating_network_id: { get_param: public_net_id }
245 port_id: { get_resource: accessible_server_port }
246
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300247 ironic_baremetal_server_port:
248 type: OS::Neutron::Port
249 properties:
250 network_id: { get_param: ironic_baremetal_network }
251 port_security_enabled: false
252 fixed_ips:
253 - subnet: { get_param: ironic_baremetal_subnet_id }
254
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200255 tun_server_port:
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400256 type: OS::Neutron::Port
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400257 properties:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200258 network_id: { get_param: tun_network }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400259 port_security_enabled: false
260 fixed_ips:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200261 - subnet: { get_param: tun_subnet_id }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400262
Mateusz Lose2ad0772020-02-27 21:41:54 +0100263 wait_handle:
264 type: OS::Heat::WaitConditionHandle
265 wait_condition:
266 type: OS::Heat::WaitCondition
267 properties:
268 handle: { get_resource: wait_handle }
269 timeout: { get_param: boot_timeout }
270
271outputs:
272 server_private_ip:
273 description: IP address of server in private network
274 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
275 server_private_floating_ip:
276 description: IP address of server in private floating network
277 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300278 server_ironic_baremetal_ip:
279 description: IP address of server in ironic baremetal network
280 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400281 server_tf_data_ip:
282 description: IP address of server in tf data network
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200283 value: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100284 server_public_ip:
285 description: Floating IP address of server in public network
286 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienko846c6342021-02-24 17:01:36 +0200287 server_tun_ip:
288 description: IP address of server in tunnel network
289 value: { get_attr: [ tun_server_port, fixed_ips, 0, ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200290 wc_data:
291 description: Metadata from instance
292 value: { get_attr: [wait_condition, data]}