Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 2 | ===== |
| 3 | Usage |
| 4 | ===== |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 5 | |
Jakub Pavlik | 3bed97a | 2016-05-20 11:16:08 +0200 | [diff] [blame] | 6 | Heat is the main project in the OpenStack Orchestration program. It implements |
| 7 | an orchestration engine to launch multiple composite cloud applications based |
| 8 | on templates in the form of text files that can be treated like code. A native |
| 9 | Heat template format is evolving, but Heat also endeavours to provide |
| 10 | compatibility with the AWS CloudFormation template format, so that many |
| 11 | existing CloudFormation templates can be launched on OpenStack. Heat provides |
| 12 | both an OpenStack-native ReST API and a CloudFormation-compatible Query API. |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 13 | |
Aleš Komárek | d13365c | 2017-04-11 13:13:37 +0200 | [diff] [blame] | 14 | Sample Pillars |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 15 | ============== |
| 16 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 17 | Single Heat services on the controller node: |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 18 | |
| 19 | .. code-block:: yaml |
| 20 | |
| 21 | heat: |
| 22 | server: |
| 23 | enabled: true |
| 24 | version: icehouse |
Jakub Pavlik | 51e15e0 | 2016-03-12 13:32:26 +0100 | [diff] [blame] | 25 | region: RegionOne |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 26 | bind: |
| 27 | metadata: |
| 28 | address: 10.0.106.10 |
| 29 | port: 8000 |
Oleksii Chupryn | cd1be6f | 2017-04-07 09:30:26 +0300 | [diff] [blame] | 30 | protocol: http |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 31 | waitcondition: |
| 32 | address: 10.0.106.10 |
| 33 | port: 8000 |
Oleksii Chupryn | cd1be6f | 2017-04-07 09:30:26 +0300 | [diff] [blame] | 34 | protocol: http |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 35 | watch: |
| 36 | address: 10.0.106.10 |
| 37 | port: 8003 |
Oleksii Chupryn | cd1be6f | 2017-04-07 09:30:26 +0300 | [diff] [blame] | 38 | protocol: http |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 39 | cloudwatch: |
| 40 | host: 10.0.106.20 |
| 41 | api: |
| 42 | host: 10.0.106.20 |
| 43 | api_cfn: |
| 44 | host: 10.0.106.20 |
| 45 | database: |
| 46 | engine: mysql |
| 47 | host: 10.0.106.20 |
| 48 | port: 3306 |
| 49 | name: heat |
| 50 | user: heat |
| 51 | password: password |
| 52 | identity: |
| 53 | engine: keystone |
| 54 | host: 10.0.106.20 |
| 55 | port: 35357 |
| 56 | tenant: service |
| 57 | user: heat |
| 58 | password: password |
Dennis Dmitriev | 0965027 | 2017-03-09 17:51:00 +0200 | [diff] [blame] | 59 | endpoint_type_default: internalURL |
| 60 | endpoint_type_heat: publicURL |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 61 | message_queue: |
| 62 | engine: rabbitmq |
| 63 | host: 10.0.106.20 |
| 64 | port: 5672 |
| 65 | user: openstack |
| 66 | password: password |
| 67 | virtual_host: '/openstack' |
| 68 | ha_queues: True |
Dmitry Stremkouski | b3d83a9 | 2017-11-08 16:01:18 +0300 | [diff] [blame] | 69 | max_stacks_per_tenant: 150 |
Dmitry Stremkouski | 9cacd16 | 2017-11-08 16:39:38 +0300 | [diff] [blame] | 70 | max_nested_stack_depth: 10 |
Daniel Cech | 4322464 | 2018-11-13 16:27:23 +0100 | [diff] [blame] | 71 | stack_action_timeout: 7200 |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 72 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 73 | Define server clients Keystone parameter: |
Ondrej Smola | 24ae6a8 | 2017-07-18 10:53:14 +0200 | [diff] [blame] | 74 | |
| 75 | .. code-block:: yaml |
| 76 | |
| 77 | heat: |
| 78 | server: |
| 79 | clients: |
| 80 | keystone: |
| 81 | protocol: https |
| 82 | host: 10.0.106.10 |
| 83 | port: 5000 |
| 84 | insecure: false |
| 85 | |
Martin Polreich | b24076f | 2018-08-27 10:42:45 +0200 | [diff] [blame] | 86 | Server with auth_encryption_key defined: |
| 87 | |
| 88 | .. code-block:: yaml |
| 89 | |
| 90 | heat: |
| 91 | server: |
| 92 | .... |
Martin Polreich | 4d7af43 | 2018-08-28 10:43:40 +0200 | [diff] [blame] | 93 | auth_encryption_key: "KeyToEncrypt-hasToBeExact32Chars" |
Martin Polreich | b24076f | 2018-08-27 10:42:45 +0200 | [diff] [blame] | 94 | .... |
| 95 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 96 | Enable CORS parameters: |
Ondrej Smola | 70f2934 | 2017-04-28 12:58:06 +0200 | [diff] [blame] | 97 | |
| 98 | .. code-block:: yaml |
| 99 | |
| 100 | heat: |
| 101 | server: |
| 102 | cors: |
| 103 | allowed_origin: https:localhost.local,http:localhost.local |
| 104 | expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token |
| 105 | allow_methods: GET,PUT,POST,DELETE,PATCH |
| 106 | allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token |
| 107 | allow_credentials: True |
| 108 | max_age: 86400 |
| 109 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 110 | Heat client with specified git templates: |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 111 | |
| 112 | .. code-block:: yaml |
| 113 | |
| 114 | heat: |
| 115 | client: |
| 116 | enabled: true |
Jiri Broulik | b2ef328 | 2017-02-07 22:33:30 +0100 | [diff] [blame] | 117 | template: |
| 118 | admin: |
| 119 | domain: default |
| 120 | source: |
| 121 | engine: git |
| 122 | address: git@repo.domain.com/admin-templates.git |
| 123 | revision: master |
| 124 | default: |
| 125 | domain: default |
| 126 | source: |
| 127 | engine: git |
| 128 | address: git@repo.domain.com/default-templates.git |
| 129 | revision: master |
| 130 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 131 | Ceilometer notification: |
Filip Pytloun | 923d869 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 132 | |
| 133 | .. code-block:: yaml |
| 134 | |
| 135 | heat: |
| 136 | server: |
| 137 | enabled: true |
| 138 | version: icehouse |
| 139 | notification: true |
| 140 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 141 | Configuration of ``policy.json`` file: |
Dmitry Ukov | f3f33a8 | 2017-05-05 11:56:46 +0400 | [diff] [blame] | 142 | |
| 143 | .. code-block:: yaml |
| 144 | |
| 145 | heat: |
| 146 | server: |
| 147 | .... |
| 148 | policy: |
| 149 | deny_stack_user: 'not role:heat_stack_user' |
| 150 | 'cloudformation:ValidateTemplate': 'rule:deny_stack_user' |
| 151 | # Add key without value to remove line from policy.json |
| 152 | 'cloudformation:DescribeStackResource': |
| 153 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 154 | Client-side RabbitMQ HA setup: |
Jiri Konecny | f94dd92 | 2016-04-20 12:09:22 +0200 | [diff] [blame] | 155 | |
| 156 | .. code-block:: yaml |
| 157 | |
| 158 | heat: |
| 159 | server: |
| 160 | .... |
| 161 | message_queue: |
| 162 | engine: rabbitmq |
| 163 | members: |
| 164 | - host: 10.0.16.1 |
| 165 | - host: 10.0.16.2 |
| 166 | - host: 10.0.16.3 |
| 167 | user: openstack |
| 168 | password: pwd |
| 169 | virtual_host: '/openstack' |
| 170 | .... |
| 171 | |
Kirill Bespalov | 00da251 | 2017-11-21 13:21:21 +0300 | [diff] [blame] | 172 | Configuring TLS communications |
| 173 | ------------------------------- |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 174 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 175 | .. note:: By default, system-wide installed CA certs are used, so the |
| 176 | ``cacert_file`` param is optional, as well as ``cacert``. |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 177 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 178 | - **RabbitMQ TLS** |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 179 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 180 | .. code-block:: yaml |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 181 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 182 | heat: |
Kirill Bespalov | 00da251 | 2017-11-21 13:21:21 +0300 | [diff] [blame] | 183 | server: |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 184 | message_queue: |
| 185 | port: 5671 |
| 186 | ssl: |
| 187 | enabled: True |
| 188 | (optional) cacert: cert body if the cacert_file does not exists |
| 189 | (optional) cacert_file: /etc/openstack/rabbitmq-ca.pem |
| 190 | (optional) version: TLSv1_2 |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 191 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 192 | - **MySQL TLS** |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 193 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 194 | .. code-block:: yaml |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 195 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 196 | heat: |
| 197 | server: |
| 198 | database: |
| 199 | ssl: |
| 200 | enabled: True |
| 201 | (optional) cacert: cert body if the cacert_file does not exists |
| 202 | (optional) cacert_file: /etc/openstack/mysql-ca.pem |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 203 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 204 | - **Openstack HTTPS API** |
| 205 | |
| 206 | .. code-block:: yaml |
| 207 | |
| 208 | heat: |
Kirill Bespalov | 00da251 | 2017-11-21 13:21:21 +0300 | [diff] [blame] | 209 | server: |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 210 | identity: |
| 211 | protocol: https |
| 212 | (optional) cacert_file: /etc/openstack/proxy.pem |
| 213 | clients: |
| 214 | keystone: |
| 215 | protocol: https |
| 216 | (optional) cacert_file: /etc/openstack/proxy.pem |
Kirill Bespalov | 27d20ca | 2017-08-06 15:43:28 +0300 | [diff] [blame] | 217 | |
Dmitry Kalashnik | 1c26ac0 | 2017-12-06 13:37:19 +0400 | [diff] [blame] | 218 | Enhanced logging with logging.conf |
| 219 | ---------------------------------- |
| 220 | |
| 221 | By default logging.conf is disabled. |
| 222 | |
| 223 | That is possible to enable per-binary logging.conf with new variables: |
Dmitry Kalashnik | 1c26ac0 | 2017-12-06 13:37:19 +0400 | [diff] [blame] | 224 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 225 | * ``openstack_log_appender`` |
| 226 | Set to true to enable ``log_config_append`` for all OpenStack services |
Dmitry Kalashnik | 1c26ac0 | 2017-12-06 13:37:19 +0400 | [diff] [blame] | 227 | |
OlgaGusarenko | 769c819 | 2018-07-30 18:16:44 +0300 | [diff] [blame] | 228 | * ``openstack_fluentd_handler_enabled`` |
| 229 | Set to true to enable ``FluentHandler`` for all Openstack services |
| 230 | |
| 231 | * ``openstack_ossyslog_handler_enabled`` |
| 232 | Set to true to enable ``OSSysLogHandler`` for all Openstack services |
| 233 | |
| 234 | Only `WatchedFileHandler``, ``OSSysLogHandler``, and ``FluentHandler`` are |
| 235 | available. |
| 236 | |
| 237 | Also, it is possible to configure this with pillar: |
Dmitry Kalashnik | 1c26ac0 | 2017-12-06 13:37:19 +0400 | [diff] [blame] | 238 | |
| 239 | .. code-block:: yaml |
| 240 | |
| 241 | heat: |
| 242 | server: |
| 243 | logging: |
| 244 | log_appender: true |
| 245 | log_handlers: |
| 246 | watchedfile: |
| 247 | enabled: true |
| 248 | fluentd: |
| 249 | enabled: true |
Oleksii Chupryn | 99a3e1b | 2018-02-07 09:40:30 +0200 | [diff] [blame] | 250 | ossyslog: |
| 251 | enabled: true |
Jiri Konecny | f94dd92 | 2016-04-20 12:09:22 +0200 | [diff] [blame] | 252 | |
Oleksandr Shyshko | 60a2b87 | 2018-08-30 17:23:24 +0300 | [diff] [blame] | 253 | Enable x509 and ssl communication between Heat and Galera cluster. |
| 254 | --------------------- |
| 255 | By default communication between Heat and Galera is unsecure. |
| 256 | |
Oleksandr Shyshko | 17b3e8e | 2018-09-07 13:55:28 +0300 | [diff] [blame] | 257 | heat: |
| 258 | server: |
| 259 | database: |
| 260 | x509: |
| 261 | enabled: True |
| 262 | |
Oleksandr Shyshko | 60a2b87 | 2018-08-30 17:23:24 +0300 | [diff] [blame] | 263 | You able to set custom certificates in pillar: |
Oleksandr Shyshko | 60a2b87 | 2018-08-30 17:23:24 +0300 | [diff] [blame] | 264 | |
| 265 | heat: |
| 266 | server: |
| 267 | database: |
| 268 | x509: |
Oleksandr Shyshko | 17b3e8e | 2018-09-07 13:55:28 +0300 | [diff] [blame] | 269 | cacert: (certificate content) |
| 270 | cert: (certificate content) |
| 271 | key: (certificate content) |
Oleksandr Shyshko | 60a2b87 | 2018-08-30 17:23:24 +0300 | [diff] [blame] | 272 | |
| 273 | You can read more about it here: |
| 274 | https://docs.openstack.org/security-guide/databases/database-access-control.html |
| 275 | |
Oleksandr Bryndzii | cfd9f8b | 2018-10-04 11:56:54 +0300 | [diff] [blame] | 276 | Heat services with memcached caching and security strategy: |
| 277 | |
| 278 | .. code-block:: yaml |
| 279 | |
| 280 | heat: |
| 281 | server: |
| 282 | enabled: true |
| 283 | ... |
| 284 | cache: |
| 285 | engine: memcached |
| 286 | members: |
| 287 | - host: 127.0.0.1 |
| 288 | port: 11211 |
| 289 | - host: 127.0.0.1 |
| 290 | port: 11211 |
| 291 | security: |
| 292 | enabled: true |
| 293 | strategy: ENCRYPT |
| 294 | secret_key: secret |
Vasyl Saienko | a08bd59 | 2018-09-10 10:47:25 +0000 | [diff] [blame] | 295 | Upgrades |
| 296 | ======== |
| 297 | |
| 298 | Each openstack formula provide set of phases (logical bloks) that will help to |
| 299 | build flexible upgrade orchestration logic for particular components. The list |
| 300 | of phases and theirs descriptions are listed in table below: |
| 301 | |
| 302 | +-------------------------------+------------------------------------------------------+ |
| 303 | | State | Description | |
| 304 | +===============================+======================================================+ |
| 305 | | <app>.upgrade.service_running | Ensure that all services for particular application | |
| 306 | | | are enabled for autostart and running | |
| 307 | +-------------------------------+------------------------------------------------------+ |
| 308 | | <app>.upgrade.service_stopped | Ensure that all services for particular application | |
| 309 | | | disabled for autostart and dead | |
| 310 | +-------------------------------+------------------------------------------------------+ |
| 311 | | <app>.upgrade.pkgs_latest | Ensure that packages used by particular application | |
| 312 | | | are installed to latest available version. | |
| 313 | | | This will not upgrade data plane packages like qemu | |
| 314 | | | and openvswitch as usually minimal required version | |
| 315 | | | in openstack services is really old. The data plane | |
| 316 | | | packages should be upgraded separately by `apt-get | |
| 317 | | | upgrade` or `apt-get dist-upgrade` | |
| 318 | | | Applying this state will not autostart service. | |
| 319 | +-------------------------------+------------------------------------------------------+ |
| 320 | | <app>.upgrade.render_config | Ensure configuration is rendered actual version. + |
| 321 | +-------------------------------+------------------------------------------------------+ |
| 322 | | <app>.upgrade.pre | We assume this state is applied on all nodes in the | |
| 323 | | | cloud before running upgrade. | |
| 324 | | | Only non destructive actions will be applied during | |
| 325 | | | this phase. Perform service built in service check | |
| 326 | | | like (keystone-manage doctor and nova-status upgrade)| |
| 327 | +-------------------------------+------------------------------------------------------+ |
| 328 | | <app>.upgrade.upgrade.pre | Mostly applicable for data plane nodes. During this | |
| 329 | | | phase resources will be gracefully removed from | |
| 330 | | | current node if it is allowed. Services for upgraded | |
| 331 | | | application will be set to admin disabled state to | |
| 332 | | | make sure node will not participate in resources | |
| 333 | | | scheduling. For example on gtw nodes this will set | |
| 334 | | | all agents to admin disable state and will move all | |
| 335 | | | routers to other agents. | |
| 336 | +-------------------------------+------------------------------------------------------+ |
| 337 | | <app>.upgrade.upgrade | This state will basically upgrade application on | |
| 338 | | | particular target. Stop services, render | |
| 339 | | | configuration, install new packages, run offline | |
| 340 | | | dbsync (for ctl), start services. Data plane should | |
| 341 | | | not be affected, only OpenStack python services. | |
| 342 | +-------------------------------+------------------------------------------------------+ |
| 343 | | <app>.upgrade.upgrade.post | Add services back to scheduling. | |
| 344 | +-------------------------------+------------------------------------------------------+ |
| 345 | | <app>.upgrade.post | This phase should be launched only when upgrade of | |
| 346 | | | the cloud is completed. Cleanup temporary files, | |
| 347 | | | perform other post upgrade tasks. | |
| 348 | +-------------------------------+------------------------------------------------------+ |
| 349 | | <app>.upgrade.verify | Here we will do basic health checks (API CRUD | |
| 350 | | | operations, verify do not have dead network | |
| 351 | | | agents/compute services) | |
| 352 | +-------------------------------+------------------------------------------------------+ |