blob: f15bff7f4e0a58a8276409c663766765da9e7e13 [file] [log] [blame]
OlgaGusarenko87eb2842018-07-30 17:51:09 +03001=====
2Usage
3=====
Filip Pytlound681ae22015-10-06 16:28:31 +02004
Jakub Pavlik9e85d172016-05-20 11:13:14 +02005The Glance project provides services for discovering, registering, and
6retrieving virtual machine images. Glance has a RESTful API that allows
7querying of VM image metadata as well as retrieval of the actual image.
Filip Pytlound681ae22015-10-06 16:28:31 +02008
Aleš Komáreke5b388f2017-02-06 15:48:57 +01009Sample pillars
10==============
Filip Pytlound681ae22015-10-06 16:28:31 +020011
12.. code-block:: yaml
13
14 glance:
15 server:
16 enabled: true
17 version: juno
Alena Holanovac1e51312016-03-22 14:08:44 +010018 workers: 8
Dmitry Stremkovskiye9490cf2017-07-11 11:37:44 +030019 glance_uid: 302
20 glance_gid: 302
Alexey V. Abashkinae99c212019-08-26 13:09:36 +030021 container_formats:
22 ami:
23 enabled: True
24 ari:
25 enabled: False
26 docker:
27 enabled: True
28 disk_formats:
29 vhd:
30 enabled: False
31 raw:
32 enabled: True
33 qcow2:
34 enabled: True
Ivan Berezovskiy4f3840e2019-11-18 20:30:15 +040035 concurrency:
36 lock_path: '/var/lib/glance/tmp'
Filip Pytlound681ae22015-10-06 16:28:31 +020037 policy:
38 publicize_image:
39 - "role:admin"
40 - "role:image_manager"
41 database:
42 engine: mysql
43 host: 127.0.0.1
44 port: 3306
45 name: glance
46 user: glance
47 password: pwd
48 identity:
49 engine: keystone
50 host: 127.0.0.1
51 port: 35357
52 tenant: service
53 user: glance
54 password: pwd
55 message_queue:
56 engine: rabbitmq
57 host: 127.0.0.1
58 port: 5672
59 user: openstack
60 password: pwd
61 virtual_host: '/openstack'
62 storage:
63 engine: file
64 images:
65 - name: "CirrOS 0.3.1"
66 format: qcow2
67 file: cirros-0.3.1-x86_64-disk.img
68 source: http://cdn.download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img
69 public: true
Petr Michalec86ec0142016-11-29 16:34:15 +010070 audit:
71 enabled: false
Simon Pasquier2acbef52017-02-03 15:09:39 +010072 api_limit_max: 100
73 limit_param_default: 50
Oleg Iurchenko68ae3552017-10-13 18:40:42 +030074 barbican:
75 enabled: true
Simon Pasquier2acbef52017-02-03 15:09:39 +010076
OlgaGusarenko87eb2842018-07-30 17:51:09 +030077The pagination is controlled by the ``api_limit_max`` and ``limit_param_default``
Simon Pasquier2acbef52017-02-03 15:09:39 +010078parameters as shown above:
79
OlgaGusarenko87eb2842018-07-30 17:51:09 +030080* ``api_limit_max``
81 Defines the maximum number of records that the server will return.
Simon Pasquier2acbef52017-02-03 15:09:39 +010082
OlgaGusarenko87eb2842018-07-30 17:51:09 +030083* ``limit_param_default``
84 The default ``limit`` parameter that applies if the request didn't define
85 it explicitly.
Filip Pytlound681ae22015-10-06 16:28:31 +020086
OlgaGusarenko87eb2842018-07-30 17:51:09 +030087Configuration of the ``policy.json`` file:
Dmitry Ukov0a228ad2017-05-15 13:35:43 +040088
89.. code-block:: yaml
90
91 glance:
92 server:
93 ....
94 policy:
95 publicize_image: "role:admin"
96 # Add key without value to remove line from policy.json
97 add_member:
OlgaGusarenko87eb2842018-07-30 17:51:09 +030098
Aleš Komáreke5b388f2017-02-06 15:48:57 +010099Keystone and cinder region
100
101.. code-block:: yaml
102
103 glance:
104 server:
105 enabled: true
106 version: kilo
107 ...
108 identity:
109 engine: keystone
110 host: 127.0.0.1
111 region: RegionTwo
112 ...
113
114Ceph integration glance
115
116.. code-block:: yaml
117
118 glance:
119 server:
120 enabled: true
121 version: juno
122 storage:
123 engine: rbd,http
124 user: glance
125 pool: images
126 chunk_size: 8
127 client_glance_key: AQDOavlU6BsSJhAAnpFR906mvdgdfRqLHwu0Uw==
128
Vasyl Saienko83575672018-07-17 18:34:43 +0300129VMWare integration:
130
131.. code-block:: yaml
132
133 glance:
134 server
135 storage:
136 engine: vmware
137 default_store: vsphere
138 vmware:
139 enabled: true
140 server_host: 1.2.3.4
141 server_username: vmware_username
142 server_password: vmware_password
143 datastores:
144 data1:
145 name: datastore_name1
146 enabled: true
147 path: datacenter_name
148 weight: 10
149 data2:
150 name: datastore_name2
151 enabled: true
152 path: datacenter_name
153
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100154RabbitMQ HA setup
155
156.. code-block:: yaml
157
158 glance:
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
steluczdf5176a2018-01-17 14:42:11 +0100172Quota Options
173
174.. code-block:: yaml
175
176 glance:
177 server:
178 ....
179 quota:
180 image_member: -1
181 image_property: 256
182 image_tag: 256
183 image_location: 15
184 user_storage: 0
185 ....
186
Kirill Bespalovb5584362017-11-20 16:42:07 +0300187Configuring TLS communications
188------------------------------
Kirill Bespalov365d2432017-07-28 09:01:04 +0300189
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300190.. note:: By default, system wide installed CA certs are used, so
191 ``cacert_file`` param is optional, as well as ``cacert``.
Kirill Bespalovb5584362017-11-20 16:42:07 +0300192
193- **RabbitMQ TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300194
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300195 .. code-block:: yaml
Kirill Bespalov365d2432017-07-28 09:01:04 +0300196
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300197 glance:
198 server:
199 message_queue:
200 port: 5671
201 ssl:
202 enabled: True
203 (optional) cacert: cert body if the cacert_file does not exists
204 (optional) cacert_file: /etc/openstack/rabbitmq-ca.pem
205 (optional) version: TLSv1_2
Kirill Bespalov365d2432017-07-28 09:01:04 +0300206
Kirill Bespalovb5584362017-11-20 16:42:07 +0300207- **MySQL TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300208
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300209 .. code-block:: yaml
Kirill Bespalov365d2432017-07-28 09:01:04 +0300210
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300211 glance:
212 server:
213 database:
214 ssl:
215 enabled: True
216 (optional) cacert: cert body if the cacert_file does not exists
217 (optional) cacert_file: /etc/openstack/mysql-ca.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300218
Kirill Bespalovb5584362017-11-20 16:42:07 +0300219- **Openstack HTTPS API**
220
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300221 Set the ``https`` as protocol at ``glance:server`` sections:
Kirill Bespalovb5584362017-11-20 16:42:07 +0300222
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300223 .. code-block:: yaml
Kirill Bespalov365d2432017-07-28 09:01:04 +0300224
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300225 glance:
226 server:
227 identity:
228 protocol: https
Kirill Bespalovb5584362017-11-20 16:42:07 +0300229 (optional) cacert_file: /etc/openstack/proxy.pem
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300230 registry:
231 protocol: https
232 (optional) cacert_file: /etc/openstack/proxy.pem
233 storage:
234 engine: cinder, swift
235 cinder:
236 protocol: https
237 (optional) cacert_file: /etc/openstack/proxy.pem
238 swift:
239 store:
240 (optional) cafile: /etc/openstack/proxy.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300241
mnederlofad6d6242017-03-30 15:31:15 +0200242Enable Glance Image Cache:
243
244.. code-block:: yaml
245
246 glance:
247 server:
248 image_cache:
249 enabled: true
250 enable_management: true
251 directory: /var/lib/glance/image-cache/
252 max_size: 21474836480
253 ....
254
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100255Enable auditing filter (CADF):
256
257.. code-block:: yaml
258
259 glance:
260 server:
261 audit:
262 enabled: true
263 ....
264 filter_factory: 'keystonemiddleware.audit:filter_factory'
265 map_file: '/etc/pycadf/glance_api_audit_map.conf'
266 ....
267
RobertJansen168e84f92017-03-30 15:45:12 +0200268Swift integration glance
269
270.. code-block:: yaml
271
272 glance:
273 server:
274 enabled: true
275 version: mitaka
276 storage:
277 engine: swift,http
278 swift:
279 store:
280 auth:
281 address: http://keystone.example.com:5000/v2.0
282 version: 2
283 endpoint_type: publicURL
284 container: glance
285 create_container_on_put: true
286 retry_get_count: 5
287 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
288 key: someRandomPassword
289
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300290Another way, which also supports multiple swift backends, can be
291configured like this:
Michel Nederlof3a867812017-05-15 09:46:11 +0200292
293.. code-block:: yaml
294
295 glance:
296 server:
297 enabled: true
298 version: mitaka
299 storage:
300 engine: swift,http
301 swift:
302 store:
303 endpoint_type: publicURL
304 container: glance
305 create_container_on_put: true
306 retry_get_count: 5
307 references:
308 my_objectstore_reference_1:
309 auth:
310 address: http://keystone.example.com:5000/v2.0
311 version: 2
312 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
313 key: someRandomPassword
314
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300315Enable CORS parameters:
Ondrej Smolae695fe82017-04-28 12:22:28 +0200316
317.. code-block:: yaml
318
319 glance:
320 server:
321 cors:
322 allowed_origin: https:localhost.local,http:localhost.local
323 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
324 allow_methods: GET,PUT,POST,DELETE,PATCH
325 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
326 allow_credentials: True
327 max_age: 86400
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100328
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200329Enable Viewing Multiple Locations
330---------------------------------
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300331
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200332If you want to expose all locations available (for example when you have
333multiple backends configured), then you can configure this like so:
334
335.. code-block:: yaml
336
337 glance:
338 server:
339 show_multiple_locations: True
340 location_strategy: store_type
341 store_type_preference: rbd,swift,file
342
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300343.. note:: The ``show_multiple_locations`` option is deprecated since
344 Newton and is planned to be handled by policy files *only*
345 starting with the Pike release.
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200346
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300347This feature is convenient in a scenario when you have swift and rbd
348configured and want to benefit from rbd enhancements.
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200349
Oleg Iurchenko68ae3552017-10-13 18:40:42 +0300350Barbican integration glance
351---------------------------
352
353.. code-block:: yaml
354
355 glance:
356 server:
357 barbican:
358 enabled: true
359
sgarbuz2d39f412018-08-27 10:44:31 +0300360Adding cron-job
361---------------
362
363.. code-block:: yaml
364
365 glance:
366 server:
367 cron:
368 cache_pruner:
369 special_period: '@daily'
370 cache_cleaner:
371 hour: '5'
372 minute: '30'
Oleksandr Bryndziif87ae002019-04-24 13:20:57 +0300373 daymonth: '\*/2'
sgarbuz2d39f412018-08-27 10:44:31 +0300374
375
376Image cache settings
377--------------------
378
379.. code-block:: yaml
380
381 glance:
382 server:
383 image_cache:
384 max_size: 10737418240
385 stall_time: 86400
386 directory: '/var/lib/glance/image-cache/'
387
Oleg Iurchenko68ae3552017-10-13 18:40:42 +0300388
Richard Felkl4143a0e2017-02-01 23:24:13 +0100389Client role
390-----------
391
392Glance images
393
394.. code-block:: yaml
395
396 glance:
397 client:
398 enabled: true
399 server:
400 profile_admin:
401 image:
402 cirros-test:
403 visibility: public
404 protected: false
405 location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200406
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400407Enhanced logging with logging.conf
408----------------------------------
409
410By default logging.conf is disabled.
411
412That is possible to enable per-binary logging.conf with new variables:
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400413
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300414* ``openstack_log_appender``
415 Set to true to enable ``log_config_append`` for all OpenStack services
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400416
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300417* ``openstack_fluentd_handler_enabled``
418 Set to true to enable FluentHandler for all Openstack services
419
420* ``openstack_ossyslog_handler_enabled``
421 Set to true to enable OSSysLogHandler for all Openstack services
422
423Only ``WatchedFileHandler``, ``OSSysLogHandler``, and ``FluentHandler``
424are available.
425
426Also, it is possible to configure this with pillar:
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400427
428.. code-block:: yaml
429
430 glance:
431 server:
432 logging:
433 log_appender: true
434 log_handlers:
435 watchedfile:
436 enabled: true
437 fluentd:
438 enabled: true
Oleksii Chupryn90a2e642018-02-06 19:53:06 +0200439 ossyslog:
440 enabled: true
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100441
Oleksandr Shyshko75e3d682018-09-07 14:07:57 +0300442Enable x509 and ssl communication between Glance and Galera cluster.
443---------------------
444By default communication between Glance and Galera is unsecure.
445
446glance:
447 server:
448 database:
449 x509:
450 enabled: True
451
452You able to set custom certificates in pillar:
453
454glance:
455 server:
456 database:
457 x509:
458 cacert: (certificate content)
459 cert: (certificate content)
460 key: (certificate content)
461
462You can read more about it here:
463 https://docs.openstack.org/security-guide/databases/database-access-control.html
464
Oleksandr Bryndziic69e8c82018-09-28 23:27:30 +0000465Glance services on controller node with memcached caching and security strategy:
466
467.. code-block:: yaml
468
469 glance:
470 server:
471 enabled: true
472 ...
473 cache:
474 engine: memcached
475 members:
476 - host: 127.0.0.1
477 port: 11211
478 - host: 127.0.0.1
479 port: 11211
480 security:
481 enabled: true
482 strategy: ENCRYPT
483 secret_key: secret
484
Oleksandr Bryndziidcf245d2018-10-24 19:10:05 +0300485Show all image locations when returning an image. This configuration option indicates
486whether to show all the image locations when returning image details to the user.
487
488.. code-block:: yaml
489
490 glance:
491 server:
492 enabled: true
493 ...
494 show_multiple_locations: True
495
Martin Polreich39511ef2019-12-17 10:49:01 +0100496Change default resource quotas using configmap template settings:
497-----------------------------------------------------------------
Oleksandr Bryndziif87ae002019-04-24 13:20:57 +0300498
499.. code-block:: yaml
500
501 glance:
502 server:
503 configmap:
504 glace_api:
505 DEFAULT:
Oleksandr Bryndziiea82e3d2019-05-15 12:18:30 +0300506 image_member_quota: 128
507 image_property_quota: 128
508 image_tag_quota: 128
509 image_location_quota: 10
510 user_storage_quota: 0
Oleksandr Bryndziif87ae002019-04-24 13:20:57 +0300511 glace_registry:
512 DEFAULT:
Oleksandr Bryndziiea82e3d2019-05-15 12:18:30 +0300513 image_member_quota: 128
514 image_property_quota: 128
515 image_tag_quota: 128
516 image_location_quota: 10
517 user_storage_quota: 0
Oleksandr Bryndziif87ae002019-04-24 13:20:57 +0300518
Martin Polreich39511ef2019-12-17 10:49:01 +0100519Change default service policy configuration:
520--------------------------------------------
521
522.. code-block:: yaml
523
524 glance:
525 server:
526 policy:
527 manage_image_cache: 'role:admin'
528 get_task: 'role:admin'
529 # Add key without value to remove line from policy.json
530 modify_member:
531
532
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100533Usage
534=====
535
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300536#. Import new public image:
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200537
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300538 .. code-block:: yaml
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200539
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100540 glance image-create --name 'Windows 7 x86_64' --is-public true --container-format bare --disk-format qcow2 < ./win7.qcow2
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200541
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300542#. Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100543
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300544 .. code-block:: yaml
Petr Michalec86ec0142016-11-29 16:34:15 +0100545
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100546 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100547
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300548#. Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100549
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300550 .. code-block:: yaml
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100551
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100552 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100553
Vasyl Saienko27185832018-09-10 10:36:00 +0000554Upgrades
555========
556
557Each openstack formula provide set of phases (logical bloks) that will help to
558build flexible upgrade orchestration logic for particular components. The list
559of phases and theirs descriptions are listed in table below:
560
561+-------------------------------+------------------------------------------------------+
562| State | Description |
563+===============================+======================================================+
564| <app>.upgrade.service_running | Ensure that all services for particular application |
565| | are enabled for autostart and running |
566+-------------------------------+------------------------------------------------------+
567| <app>.upgrade.service_stopped | Ensure that all services for particular application |
568| | disabled for autostart and dead |
569+-------------------------------+------------------------------------------------------+
570| <app>.upgrade.pkgs_latest | Ensure that packages used by particular application |
571| | are installed to latest available version. |
572| | This will not upgrade data plane packages like qemu |
573| | and openvswitch as usually minimal required version |
574| | in openstack services is really old. The data plane |
575| | packages should be upgraded separately by `apt-get |
576| | upgrade` or `apt-get dist-upgrade` |
577| | Applying this state will not autostart service. |
578+-------------------------------+------------------------------------------------------+
579| <app>.upgrade.render_config | Ensure configuration is rendered actual version. +
580+-------------------------------+------------------------------------------------------+
581| <app>.upgrade.pre | We assume this state is applied on all nodes in the |
582| | cloud before running upgrade. |
583| | Only non destructive actions will be applied during |
584| | this phase. Perform service built in service check |
585| | like (keystone-manage doctor and nova-status upgrade)|
586+-------------------------------+------------------------------------------------------+
587| <app>.upgrade.upgrade.pre | Mostly applicable for data plane nodes. During this |
588| | phase resources will be gracefully removed from |
589| | current node if it is allowed. Services for upgraded |
590| | application will be set to admin disabled state to |
591| | make sure node will not participate in resources |
592| | scheduling. For example on gtw nodes this will set |
593| | all agents to admin disable state and will move all |
594| | routers to other agents. |
595+-------------------------------+------------------------------------------------------+
596| <app>.upgrade.upgrade | This state will basically upgrade application on |
597| | particular target. Stop services, render |
598| | configuration, install new packages, run offline |
599| | dbsync (for ctl), start services. Data plane should |
600| | not be affected, only OpenStack python services. |
601+-------------------------------+------------------------------------------------------+
602| <app>.upgrade.upgrade.post | Add services back to scheduling. |
603+-------------------------------+------------------------------------------------------+
604| <app>.upgrade.post | This phase should be launched only when upgrade of |
605| | the cloud is completed. Cleanup temporary files, |
606| | perform other post upgrade tasks. |
607+-------------------------------+------------------------------------------------------+
608| <app>.upgrade.verify | Here we will do basic health checks (API CRUD |
609| | operations, verify do not have dead network |
610| | agents/compute services) |
611+-------------------------------+------------------------------------------------------+
612
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200613
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300614Read more
615==========
Filip Pytlound681ae22015-10-06 16:28:31 +0200616
617* http://ceph.com/docs/master/rbd/rbd-openstack/