blob: f1f5d5ae6ed586b3761736237b298eaf7bbce7d2 [file] [log] [blame]
Filip Pytloun923d8692015-10-06 16:28:32 +02001
OlgaGusarenko769c8192018-07-30 18:16:44 +03002=====
3Usage
4=====
Filip Pytloun923d8692015-10-06 16:28:32 +02005
Jakub Pavlik3bed97a2016-05-20 11:16:08 +02006Heat is the main project in the OpenStack Orchestration program. It implements
7an orchestration engine to launch multiple composite cloud applications based
8on templates in the form of text files that can be treated like code. A native
9Heat template format is evolving, but Heat also endeavours to provide
10compatibility with the AWS CloudFormation template format, so that many
11existing CloudFormation templates can be launched on OpenStack. Heat provides
12both an OpenStack-native ReST API and a CloudFormation-compatible Query API.
Filip Pytloun923d8692015-10-06 16:28:32 +020013
Aleš Komárekd13365c2017-04-11 13:13:37 +020014Sample Pillars
Filip Pytloun923d8692015-10-06 16:28:32 +020015==============
16
OlgaGusarenko769c8192018-07-30 18:16:44 +030017Single Heat services on the controller node:
Filip Pytloun923d8692015-10-06 16:28:32 +020018
19.. code-block:: yaml
20
21 heat:
22 server:
23 enabled: true
24 version: icehouse
Jakub Pavlik51e15e02016-03-12 13:32:26 +010025 region: RegionOne
Mykyta Karpin3e969972019-01-29 10:57:18 +020026 reauthentication_auth_method: trusts
Filip Pytloun923d8692015-10-06 16:28:32 +020027 bind:
28 metadata:
29 address: 10.0.106.10
30 port: 8000
Oleksii Chupryncd1be6f2017-04-07 09:30:26 +030031 protocol: http
Filip Pytloun923d8692015-10-06 16:28:32 +020032 waitcondition:
33 address: 10.0.106.10
34 port: 8000
Oleksii Chupryncd1be6f2017-04-07 09:30:26 +030035 protocol: http
Filip Pytloun923d8692015-10-06 16:28:32 +020036 watch:
37 address: 10.0.106.10
38 port: 8003
Oleksii Chupryncd1be6f2017-04-07 09:30:26 +030039 protocol: http
Filip Pytloun923d8692015-10-06 16:28:32 +020040 cloudwatch:
41 host: 10.0.106.20
42 api:
43 host: 10.0.106.20
44 api_cfn:
45 host: 10.0.106.20
46 database:
47 engine: mysql
48 host: 10.0.106.20
49 port: 3306
50 name: heat
51 user: heat
52 password: password
53 identity:
54 engine: keystone
55 host: 10.0.106.20
56 port: 35357
57 tenant: service
58 user: heat
59 password: password
Dennis Dmitriev09650272017-03-09 17:51:00 +020060 endpoint_type_default: internalURL
61 endpoint_type_heat: publicURL
Filip Pytloun923d8692015-10-06 16:28:32 +020062 message_queue:
63 engine: rabbitmq
64 host: 10.0.106.20
65 port: 5672
66 user: openstack
67 password: password
68 virtual_host: '/openstack'
69 ha_queues: True
Dmitry Stremkouskib3d83a92017-11-08 16:01:18 +030070 max_stacks_per_tenant: 150
Dmitry Stremkouski9cacd162017-11-08 16:39:38 +030071 max_nested_stack_depth: 10
Daniel Cech43224642018-11-13 16:27:23 +010072 stack_action_timeout: 7200
Filip Pytloun923d8692015-10-06 16:28:32 +020073
OlgaGusarenko769c8192018-07-30 18:16:44 +030074Define server clients Keystone parameter:
Ondrej Smola24ae6a82017-07-18 10:53:14 +020075
76.. code-block:: yaml
77
78 heat:
79 server:
80 clients:
81 keystone:
82 protocol: https
83 host: 10.0.106.10
84 port: 5000
85 insecure: false
86
Martin Polreichb24076f2018-08-27 10:42:45 +020087Server with auth_encryption_key defined:
88
89.. code-block:: yaml
90
91 heat:
92 server:
93 ....
Martin Polreich4d7af432018-08-28 10:43:40 +020094 auth_encryption_key: "KeyToEncrypt-hasToBeExact32Chars"
Martin Polreichb24076f2018-08-27 10:42:45 +020095 ....
96
OlgaGusarenko769c8192018-07-30 18:16:44 +030097Enable CORS parameters:
Ondrej Smola70f29342017-04-28 12:58:06 +020098
99.. code-block:: yaml
100
101 heat:
102 server:
103 cors:
104 allowed_origin: https:localhost.local,http:localhost.local
105 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
106 allow_methods: GET,PUT,POST,DELETE,PATCH
107 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
108 allow_credentials: True
109 max_age: 86400
110
OlgaGusarenko769c8192018-07-30 18:16:44 +0300111Heat client with specified git templates:
Filip Pytloun923d8692015-10-06 16:28:32 +0200112
113.. code-block:: yaml
114
115 heat:
116 client:
117 enabled: true
Jiri Broulikb2ef3282017-02-07 22:33:30 +0100118 template:
119 admin:
120 domain: default
121 source:
122 engine: git
123 address: git@repo.domain.com/admin-templates.git
124 revision: master
125 default:
126 domain: default
127 source:
128 engine: git
129 address: git@repo.domain.com/default-templates.git
130 revision: master
131
OlgaGusarenko769c8192018-07-30 18:16:44 +0300132Ceilometer notification:
Filip Pytloun923d8692015-10-06 16:28:32 +0200133
134.. code-block:: yaml
135
136 heat:
137 server:
138 enabled: true
139 version: icehouse
140 notification: true
141
OlgaGusarenko769c8192018-07-30 18:16:44 +0300142Configuration of ``policy.json`` file:
Dmitry Ukovf3f33a82017-05-05 11:56:46 +0400143
144.. code-block:: yaml
145
146 heat:
147 server:
148 ....
149 policy:
150 deny_stack_user: 'not role:heat_stack_user'
151 'cloudformation:ValidateTemplate': 'rule:deny_stack_user'
152 # Add key without value to remove line from policy.json
153 'cloudformation:DescribeStackResource':
154
OlgaGusarenko769c8192018-07-30 18:16:44 +0300155Client-side RabbitMQ HA setup:
Jiri Konecnyf94dd922016-04-20 12:09:22 +0200156
157.. code-block:: yaml
158
159 heat:
160 server:
161 ....
162 message_queue:
163 engine: rabbitmq
164 members:
165 - host: 10.0.16.1
166 - host: 10.0.16.2
167 - host: 10.0.16.3
168 user: openstack
169 password: pwd
170 virtual_host: '/openstack'
171 ....
172
Kirill Bespalov00da2512017-11-21 13:21:21 +0300173Configuring TLS communications
174-------------------------------
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300175
OlgaGusarenko769c8192018-07-30 18:16:44 +0300176.. note:: By default, system-wide installed CA certs are used, so the
177 ``cacert_file`` param is optional, as well as ``cacert``.
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300178
OlgaGusarenko769c8192018-07-30 18:16:44 +0300179- **RabbitMQ TLS**
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300180
OlgaGusarenko769c8192018-07-30 18:16:44 +0300181 .. code-block:: yaml
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300182
OlgaGusarenko769c8192018-07-30 18:16:44 +0300183 heat:
Kirill Bespalov00da2512017-11-21 13:21:21 +0300184 server:
OlgaGusarenko769c8192018-07-30 18:16:44 +0300185 message_queue:
186 port: 5671
187 ssl:
188 enabled: True
189 (optional) cacert: cert body if the cacert_file does not exists
190 (optional) cacert_file: /etc/openstack/rabbitmq-ca.pem
191 (optional) version: TLSv1_2
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300192
OlgaGusarenko769c8192018-07-30 18:16:44 +0300193- **MySQL TLS**
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300194
OlgaGusarenko769c8192018-07-30 18:16:44 +0300195 .. code-block:: yaml
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300196
OlgaGusarenko769c8192018-07-30 18:16:44 +0300197 heat:
198 server:
199 database:
200 ssl:
201 enabled: True
202 (optional) cacert: cert body if the cacert_file does not exists
203 (optional) cacert_file: /etc/openstack/mysql-ca.pem
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300204
OlgaGusarenko769c8192018-07-30 18:16:44 +0300205- **Openstack HTTPS API**
206
207 .. code-block:: yaml
208
209 heat:
Kirill Bespalov00da2512017-11-21 13:21:21 +0300210 server:
OlgaGusarenko769c8192018-07-30 18:16:44 +0300211 identity:
212 protocol: https
213 (optional) cacert_file: /etc/openstack/proxy.pem
214 clients:
215 keystone:
216 protocol: https
217 (optional) cacert_file: /etc/openstack/proxy.pem
Kirill Bespalov27d20ca2017-08-06 15:43:28 +0300218
Dmitry Kalashnik1c26ac02017-12-06 13:37:19 +0400219Enhanced logging with logging.conf
220----------------------------------
221
222By default logging.conf is disabled.
223
224That is possible to enable per-binary logging.conf with new variables:
Dmitry Kalashnik1c26ac02017-12-06 13:37:19 +0400225
OlgaGusarenko769c8192018-07-30 18:16:44 +0300226* ``openstack_log_appender``
227 Set to true to enable ``log_config_append`` for all OpenStack services
Dmitry Kalashnik1c26ac02017-12-06 13:37:19 +0400228
OlgaGusarenko769c8192018-07-30 18:16:44 +0300229* ``openstack_fluentd_handler_enabled``
230 Set to true to enable ``FluentHandler`` for all Openstack services
231
232* ``openstack_ossyslog_handler_enabled``
233 Set to true to enable ``OSSysLogHandler`` for all Openstack services
234
235Only `WatchedFileHandler``, ``OSSysLogHandler``, and ``FluentHandler`` are
236available.
237
238Also, it is possible to configure this with pillar:
Dmitry Kalashnik1c26ac02017-12-06 13:37:19 +0400239
240.. code-block:: yaml
241
242 heat:
243 server:
244 logging:
245 log_appender: true
246 log_handlers:
247 watchedfile:
248 enabled: true
249 fluentd:
250 enabled: true
Oleksii Chupryn99a3e1b2018-02-07 09:40:30 +0200251 ossyslog:
252 enabled: true
Jiri Konecnyf94dd922016-04-20 12:09:22 +0200253
Oleksandr Shyshko60a2b872018-08-30 17:23:24 +0300254Enable x509 and ssl communication between Heat and Galera cluster.
255---------------------
256By default communication between Heat and Galera is unsecure.
257
Oleksandr Shyshko17b3e8e2018-09-07 13:55:28 +0300258heat:
259 server:
260 database:
261 x509:
262 enabled: True
263
Oleksandr Shyshko60a2b872018-08-30 17:23:24 +0300264You able to set custom certificates in pillar:
Oleksandr Shyshko60a2b872018-08-30 17:23:24 +0300265
266heat:
267 server:
268 database:
269 x509:
Oleksandr Shyshko17b3e8e2018-09-07 13:55:28 +0300270 cacert: (certificate content)
271 cert: (certificate content)
272 key: (certificate content)
Oleksandr Shyshko60a2b872018-08-30 17:23:24 +0300273
274You can read more about it here:
275 https://docs.openstack.org/security-guide/databases/database-access-control.html
276
Oleksandr Bryndziicfd9f8b2018-10-04 11:56:54 +0300277Heat services with memcached caching and security strategy:
278
279.. code-block:: yaml
280
281 heat:
282 server:
283 enabled: true
284 ...
285 cache:
286 engine: memcached
287 members:
288 - host: 127.0.0.1
289 port: 11211
290 - host: 127.0.0.1
291 port: 11211
292 security:
293 enabled: true
294 strategy: ENCRYPT
295 secret_key: secret
Oleksandr Bryndziif1218e92019-05-06 12:23:15 +0300296
297Heat configmap setup:
298---------------
299
300.. code-block:: yaml
301
302 heat:
303 server:
304 configmap:
305 DEFAULT:
306 debug: true
307 database:
308 idle_timeout: 300
309 min_pool_size: 5
310 max_pool_size: 50
311 oslo_messaging_rabbit:
312 pool_max_size: 30
313 pool_max_overflow: 30
314 pool_recycle: 600
315
Martin Polreiched3f41d2019-12-17 11:08:57 +0100316
317Change default service policy configuration:
318--------------------------------------------
319
320.. code-block:: yaml
321
322 heat:
323 server:
324 policy:
325 deny_stack_user: not role:heat_stack_user
326 deny_everybody: '!'
327 # Add key without value to remove line from policy.json
328 cloudformation:ListStacks:
Oleksandr Bryndziif1218e92019-05-06 12:23:15 +0300329
Vladimir Khlyunevbed0a4d2020-05-13 12:58:39 +0400330
331Enable stack abandon and/or stack adopt features:
332-------------------------------------------------
333
334.. code-block:: yaml
335
336 heat:
337 server:
338 enable_stack_abandon: true
339 enable_stack_adopt: true
340
Taras Khlivnyak21f35be2021-08-19 12:17:23 +0300341
342Change files/directories permissions for heat service:
343=======================================
344In order to change file permissions the following should be set:
345
346'files' - block to set permissions for files.
347- full path to file
348- user ( default value is 'root' ) this parameter is optional.
349- group ( default value is 'heat' ) this parameter is optional
350- mode ( default value is '0640' ) this parameter is optional
351
352'directories' - block to set permissions for directories.
353- full path to directory
354- user ( default value is 'root' ) this parameter is optional
355- group ( default value is 'heat' ) this parameter is optional
356- mode ( default value is '0750' ) this parameter is optional
357
358.. code-block:: yaml
359
360 heat:
361 files:
362 /etc/heat/heat.conf:
363 user: 'root'
364 group: 'heat'
365 mode: '0750'
366 directories:
367 /etc/heat:
368 user: 'root'
369 group: 'heat'
370 mode: '0750'
371
372
Vasyl Saienkoa08bd592018-09-10 10:47:25 +0000373Upgrades
374========
375
376Each openstack formula provide set of phases (logical bloks) that will help to
377build flexible upgrade orchestration logic for particular components. The list
378of phases and theirs descriptions are listed in table below:
379
380+-------------------------------+------------------------------------------------------+
381| State | Description |
382+===============================+======================================================+
383| <app>.upgrade.service_running | Ensure that all services for particular application |
384| | are enabled for autostart and running |
385+-------------------------------+------------------------------------------------------+
386| <app>.upgrade.service_stopped | Ensure that all services for particular application |
387| | disabled for autostart and dead |
388+-------------------------------+------------------------------------------------------+
389| <app>.upgrade.pkgs_latest | Ensure that packages used by particular application |
390| | are installed to latest available version. |
391| | This will not upgrade data plane packages like qemu |
392| | and openvswitch as usually minimal required version |
393| | in openstack services is really old. The data plane |
394| | packages should be upgraded separately by `apt-get |
395| | upgrade` or `apt-get dist-upgrade` |
396| | Applying this state will not autostart service. |
397+-------------------------------+------------------------------------------------------+
398| <app>.upgrade.render_config | Ensure configuration is rendered actual version. +
399+-------------------------------+------------------------------------------------------+
400| <app>.upgrade.pre | We assume this state is applied on all nodes in the |
401| | cloud before running upgrade. |
402| | Only non destructive actions will be applied during |
403| | this phase. Perform service built in service check |
404| | like (keystone-manage doctor and nova-status upgrade)|
405+-------------------------------+------------------------------------------------------+
406| <app>.upgrade.upgrade.pre | Mostly applicable for data plane nodes. During this |
407| | phase resources will be gracefully removed from |
408| | current node if it is allowed. Services for upgraded |
409| | application will be set to admin disabled state to |
410| | make sure node will not participate in resources |
411| | scheduling. For example on gtw nodes this will set |
412| | all agents to admin disable state and will move all |
413| | routers to other agents. |
414+-------------------------------+------------------------------------------------------+
415| <app>.upgrade.upgrade | This state will basically upgrade application on |
416| | particular target. Stop services, render |
417| | configuration, install new packages, run offline |
418| | dbsync (for ctl), start services. Data plane should |
419| | not be affected, only OpenStack python services. |
420+-------------------------------+------------------------------------------------------+
421| <app>.upgrade.upgrade.post | Add services back to scheduling. |
422+-------------------------------+------------------------------------------------------+
423| <app>.upgrade.post | This phase should be launched only when upgrade of |
424| | the cloud is completed. Cleanup temporary files, |
425| | perform other post upgrade tasks. |
426+-------------------------------+------------------------------------------------------+
427| <app>.upgrade.verify | Here we will do basic health checks (API CRUD |
428| | operations, verify do not have dead network |
429| | agents/compute services) |
430+-------------------------------+------------------------------------------------------+
Dzmitry Stremkouski4058d702020-07-06 23:46:05 +0200431
432Execute database maintenance tasks
433----------------------------------
434Cleanup stale records from heat database to make it smaller.
435This is helpful before any upgrade activity.
436It is safe to execute it generally without maintenance window same as online db_sync.
437
438Enable this pillar:
439
440.. code-block:: yaml
441
442 heat:
443 server:
444 db_purge:
445 enabled: True
446
447Execute state heat.db.db_cleanup to purge stale records:
448
449.. code-block:: bash
450
451 salt -C 'I@heat:server:role:primary' state.apply heat.db.db_cleanup -l debug
452
453It is possible to pass days parameter.
454If you skip setting it, all records would be archived/purged:
455
456.. code-block:: yaml
457
458 heat:
459 server:
460 db_purge:
461 enabled: True
462 days: 45
463