blob: 622f6111ef92ccbd92dcf56a8a7e1d9106382eb7 [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
Oleh Hryhorove7feab42020-11-11 18:00:29 +020061 tun_network:
Anton Samoylovea0b23e2020-06-26 14:17:51 +040062 type: string
Oleh Hryhorove7feab42020-11-11 18:00:29 +020063 tun_subnet_id:
Anton Samoylovea0b23e2020-06-26 14:17:51 +040064 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
Stepan Rogov60bc3522020-12-16 17:43:25 +030076 docker_default_address_pool:
77 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010078 public_net_id:
79 type: string
80 docker_ee_release:
81 type: string
82 docker_ee_url:
83 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020084 hardware_metadata:
85 description: The content of lab metadata.
86 type: string
Oleh Hryhorov33e30e22020-03-12 11:51:40 +020087 user_data_config:
88 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
89 type: string
90 default: |
91 #cloud-config
92 #
93 # Don't mount ephemeral0 to /mnt as it's by default
94 mounts:
95 - [ ephemeral0, null ]
Mykyta Karpin6a153c52020-11-03 15:21:38 +020096 huge_pages:
97 description: >
98 String formatted as '<Number of Gb for 1Gb huge pages>,<Number of Mb for 2Mb huge pages'
99 If number is equal to 0 alloacation of huge pages won't be configured.
100 default: '0,0'
101 type: string
Vasyl Saienko846c6342021-02-24 17:01:36 +0200102 frr_bgp_neighbors:
103 description: Comma separated list of IP of BGP neighbors
104 default: ''
105 type: string
Oleksii Grudev4e3c8b42021-03-02 19:02:45 +0200106 lvm_loop_device_size:
107 type: number
108 default: 0
Mateusz Lose2ad0772020-02-27 21:41:54 +0100109
110resources:
111
112 software_config:
113 type: OS::Heat::SoftwareConfig
114 properties:
115 group: ungrouped
116 config:
117 str_replace:
118 template: { get_file: ../scripts/instance_boot.sh }
119 params:
120 $node_type: { get_param: node_type }
121 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100122 $docker_ee_url: { get_param: docker_ee_url }
123 $docker_ee_release: { get_param: docker_ee_release }
124 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300125 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300126 $docker_default_address_pool: { get_param: docker_default_address_pool }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100127 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200128 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100129 $private_floating_interface: { get_param: private_floating_interface }
130 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
131 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
132 $functions_override: { get_param: functions_override }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200133 $storage_frontend_interface: { get_param: storage_frontend_interface }
134 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
135 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
136 $storage_backend_interface: { get_param: storage_backend_interface }
137 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
138 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300139 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300140 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400141 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
Vasyl Saienko3dd0c272020-11-16 17:20:07 +0200142 $tunnel_interface_ip: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400143 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Mykyta Karpin6a153c52020-11-03 15:21:38 +0200144 $huge_pages: { get_param: huge_pages }
Anton Samoylovec019d52020-11-19 18:55:47 +0400145 $tungstenfabric_enabled: { get_param: tungstenfabric_enabled }
Vasyl Saienko846c6342021-02-24 17:01:36 +0200146 $frr_bgp_neighbors: { get_param: frr_bgp_neighbors }
Oleksii Grudev4e3c8b42021-03-02 19:02:45 +0200147 $lvm_loop_device_size: { get_param: lvm_loop_device_size }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100148
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200149 inject_files:
150 type: "OS::Heat::CloudConfig"
151 properties:
152 cloud_config:
153 write_files:
154 - path: /usr/sbin/prepare-metadata.py
155 owner: "root:root"
156 permissions: "0755"
157 content: {get_file: ../scripts/prepare-metadata.py}
158 - path: /usr/share/metadata/lab-metadata.yaml
159 owner: "root:root"
160 permissions: "0644"
161 content: { get_param: hardware_metadata}
162
163 install_config_agent:
164 type: "OS::Heat::MultipartMime"
165 properties:
166 parts:
167 - config: {get_resource: software_config}
168 - config: {get_resource: inject_files}
Oleh Hryhorov33e30e22020-03-12 11:51:40 +0200169 - config: {get_param: user_data_config}
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200170
Mateusz Lose2ad0772020-02-27 21:41:54 +0100171 server:
172 type: OS::Nova::Server
173 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200174 config_drive: true
Mateusz Lose2ad0772020-02-27 21:41:54 +0100175 image: { get_param: image }
176 flavor: { get_param: flavor }
177 key_name: { get_param: key_name }
178 availability_zone: nova
179 networks:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200180 - port: { get_resource: accessible_server_port }
181 - port: { get_resource: private_floating_server_port }
182 - port: { get_resource: storage_frontend_server_port }
183 - port: { get_resource: storage_backend_server_port }
184 - port: { get_resource: ironic_baremetal_server_port }
185 - port: { get_resource: tun_server_port }
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200186 user_data_format: SOFTWARE_CONFIG
187 user_data: { get_resource: install_config_agent}
Mateusz Lose2ad0772020-02-27 21:41:54 +0100188 metadata: { get_param: metadata }
189
190 accessible_server_port:
191 type: OS::Neutron::Port
192 properties:
193 network_id: { get_param: accessible_network }
194 port_security_enabled: false
195 fixed_ips:
196 - subnet: { get_param: accessible_subnet_id }
197
198 storage_backend_server_port:
199 type: OS::Neutron::Port
200 properties:
201 network_id: { get_param: storage_backend_network }
202 port_security_enabled: false
203 fixed_ips:
204 - subnet: { get_param: storage_backend_subnet_id }
205
206 storage_frontend_server_port:
207 type: OS::Neutron::Port
208 properties:
209 network_id: { get_param: storage_frontend_network }
210 port_security_enabled: false
211 fixed_ips:
212 - subnet: { get_param: storage_frontend_subnet_id }
213
214 private_floating_server_port:
215 type: OS::Neutron::Port
216 properties:
217 network_id: { get_param: private_floating_network }
218 port_security_enabled: false
219 fixed_ips:
220 - subnet: { get_param: private_floating_subnet_id }
221
222 server_floating_ip:
223 type: OS::Neutron::FloatingIP
224 properties:
225 floating_network_id: { get_param: public_net_id }
226 port_id: { get_resource: accessible_server_port }
227
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300228 ironic_baremetal_server_port:
229 type: OS::Neutron::Port
230 properties:
231 network_id: { get_param: ironic_baremetal_network }
232 port_security_enabled: false
233 fixed_ips:
234 - subnet: { get_param: ironic_baremetal_subnet_id }
235
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200236 tun_server_port:
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400237 type: OS::Neutron::Port
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400238 properties:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200239 network_id: { get_param: tun_network }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400240 port_security_enabled: false
241 fixed_ips:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200242 - subnet: { get_param: tun_subnet_id }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400243
Mateusz Lose2ad0772020-02-27 21:41:54 +0100244 wait_handle:
245 type: OS::Heat::WaitConditionHandle
246 wait_condition:
247 type: OS::Heat::WaitCondition
248 properties:
249 handle: { get_resource: wait_handle }
250 timeout: { get_param: boot_timeout }
251
252outputs:
253 server_private_ip:
254 description: IP address of server in private network
255 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
256 server_private_floating_ip:
257 description: IP address of server in private floating network
258 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300259 server_ironic_baremetal_ip:
260 description: IP address of server in ironic baremetal network
261 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400262 server_tf_data_ip:
263 description: IP address of server in tf data network
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200264 value: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100265 server_public_ip:
266 description: Floating IP address of server in public network
267 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienko846c6342021-02-24 17:01:36 +0200268 server_tun_ip:
269 description: IP address of server in tunnel network
270 value: { get_attr: [ tun_server_port, fixed_ips, 0, ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200271 wc_data:
272 description: Metadata from instance
273 value: { get_attr: [wait_condition, data]}