blob: 07bd013dd8f4ba01b0d4d8482697c491cf7dcdce [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
Filip Pytlound681ae22015-10-06 16:28:31 +020035 policy:
36 publicize_image:
37 - "role:admin"
38 - "role:image_manager"
39 database:
40 engine: mysql
41 host: 127.0.0.1
42 port: 3306
43 name: glance
44 user: glance
45 password: pwd
46 identity:
47 engine: keystone
48 host: 127.0.0.1
49 port: 35357
50 tenant: service
51 user: glance
52 password: pwd
53 message_queue:
54 engine: rabbitmq
55 host: 127.0.0.1
56 port: 5672
57 user: openstack
58 password: pwd
59 virtual_host: '/openstack'
60 storage:
61 engine: file
62 images:
63 - name: "CirrOS 0.3.1"
64 format: qcow2
65 file: cirros-0.3.1-x86_64-disk.img
66 source: http://cdn.download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img
67 public: true
Petr Michalec86ec0142016-11-29 16:34:15 +010068 audit:
69 enabled: false
Simon Pasquier2acbef52017-02-03 15:09:39 +010070 api_limit_max: 100
71 limit_param_default: 50
Oleg Iurchenko68ae3552017-10-13 18:40:42 +030072 barbican:
73 enabled: true
Simon Pasquier2acbef52017-02-03 15:09:39 +010074
OlgaGusarenko87eb2842018-07-30 17:51:09 +030075The pagination is controlled by the ``api_limit_max`` and ``limit_param_default``
Simon Pasquier2acbef52017-02-03 15:09:39 +010076parameters as shown above:
77
OlgaGusarenko87eb2842018-07-30 17:51:09 +030078* ``api_limit_max``
79 Defines the maximum number of records that the server will return.
Simon Pasquier2acbef52017-02-03 15:09:39 +010080
OlgaGusarenko87eb2842018-07-30 17:51:09 +030081* ``limit_param_default``
82 The default ``limit`` parameter that applies if the request didn't define
83 it explicitly.
Filip Pytlound681ae22015-10-06 16:28:31 +020084
OlgaGusarenko87eb2842018-07-30 17:51:09 +030085Configuration of the ``policy.json`` file:
Dmitry Ukov0a228ad2017-05-15 13:35:43 +040086
87.. code-block:: yaml
88
89 glance:
90 server:
91 ....
92 policy:
93 publicize_image: "role:admin"
94 # Add key without value to remove line from policy.json
95 add_member:
OlgaGusarenko87eb2842018-07-30 17:51:09 +030096
Aleš Komáreke5b388f2017-02-06 15:48:57 +010097Keystone and cinder region
98
99.. code-block:: yaml
100
101 glance:
102 server:
103 enabled: true
104 version: kilo
105 ...
106 identity:
107 engine: keystone
108 host: 127.0.0.1
109 region: RegionTwo
110 ...
111
112Ceph integration glance
113
114.. code-block:: yaml
115
116 glance:
117 server:
118 enabled: true
119 version: juno
120 storage:
121 engine: rbd,http
122 user: glance
123 pool: images
124 chunk_size: 8
125 client_glance_key: AQDOavlU6BsSJhAAnpFR906mvdgdfRqLHwu0Uw==
126
Vasyl Saienko83575672018-07-17 18:34:43 +0300127VMWare integration:
128
129.. code-block:: yaml
130
131 glance:
132 server
133 storage:
134 engine: vmware
135 default_store: vsphere
136 vmware:
137 enabled: true
138 server_host: 1.2.3.4
139 server_username: vmware_username
140 server_password: vmware_password
141 datastores:
142 data1:
143 name: datastore_name1
144 enabled: true
145 path: datacenter_name
146 weight: 10
147 data2:
148 name: datastore_name2
149 enabled: true
150 path: datacenter_name
151
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100152RabbitMQ HA setup
153
154.. code-block:: yaml
155
156 glance:
157 server:
158 ....
159 message_queue:
160 engine: rabbitmq
161 members:
162 - host: 10.0.16.1
163 - host: 10.0.16.2
164 - host: 10.0.16.3
165 user: openstack
166 password: pwd
167 virtual_host: '/openstack'
168 ....
169
steluczdf5176a2018-01-17 14:42:11 +0100170Quota Options
171
172.. code-block:: yaml
173
174 glance:
175 server:
176 ....
177 quota:
178 image_member: -1
179 image_property: 256
180 image_tag: 256
181 image_location: 15
182 user_storage: 0
183 ....
184
Kirill Bespalovb5584362017-11-20 16:42:07 +0300185Configuring TLS communications
186------------------------------
Kirill Bespalov365d2432017-07-28 09:01:04 +0300187
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300188.. note:: By default, system wide installed CA certs are used, so
189 ``cacert_file`` param is optional, as well as ``cacert``.
Kirill Bespalovb5584362017-11-20 16:42:07 +0300190
191- **RabbitMQ TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300192
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300193 .. code-block:: yaml
Kirill Bespalov365d2432017-07-28 09:01:04 +0300194
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300195 glance:
196 server:
197 message_queue:
198 port: 5671
199 ssl:
200 enabled: True
201 (optional) cacert: cert body if the cacert_file does not exists
202 (optional) cacert_file: /etc/openstack/rabbitmq-ca.pem
203 (optional) version: TLSv1_2
Kirill Bespalov365d2432017-07-28 09:01:04 +0300204
Kirill Bespalovb5584362017-11-20 16:42:07 +0300205- **MySQL TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300206
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300207 .. code-block:: yaml
Kirill Bespalov365d2432017-07-28 09:01:04 +0300208
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300209 glance:
210 server:
211 database:
212 ssl:
213 enabled: True
214 (optional) cacert: cert body if the cacert_file does not exists
215 (optional) cacert_file: /etc/openstack/mysql-ca.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300216
Kirill Bespalovb5584362017-11-20 16:42:07 +0300217- **Openstack HTTPS API**
218
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300219 Set the ``https`` as protocol at ``glance:server`` sections:
Kirill Bespalovb5584362017-11-20 16:42:07 +0300220
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300221 .. code-block:: yaml
Kirill Bespalov365d2432017-07-28 09:01:04 +0300222
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300223 glance:
224 server:
225 identity:
226 protocol: https
Kirill Bespalovb5584362017-11-20 16:42:07 +0300227 (optional) cacert_file: /etc/openstack/proxy.pem
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300228 registry:
229 protocol: https
230 (optional) cacert_file: /etc/openstack/proxy.pem
231 storage:
232 engine: cinder, swift
233 cinder:
234 protocol: https
235 (optional) cacert_file: /etc/openstack/proxy.pem
236 swift:
237 store:
238 (optional) cafile: /etc/openstack/proxy.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300239
mnederlofad6d6242017-03-30 15:31:15 +0200240Enable Glance Image Cache:
241
242.. code-block:: yaml
243
244 glance:
245 server:
246 image_cache:
247 enabled: true
248 enable_management: true
249 directory: /var/lib/glance/image-cache/
250 max_size: 21474836480
251 ....
252
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100253Enable auditing filter (CADF):
254
255.. code-block:: yaml
256
257 glance:
258 server:
259 audit:
260 enabled: true
261 ....
262 filter_factory: 'keystonemiddleware.audit:filter_factory'
263 map_file: '/etc/pycadf/glance_api_audit_map.conf'
264 ....
265
RobertJansen168e84f92017-03-30 15:45:12 +0200266Swift integration glance
267
268.. code-block:: yaml
269
270 glance:
271 server:
272 enabled: true
273 version: mitaka
274 storage:
275 engine: swift,http
276 swift:
277 store:
278 auth:
279 address: http://keystone.example.com:5000/v2.0
280 version: 2
281 endpoint_type: publicURL
282 container: glance
283 create_container_on_put: true
284 retry_get_count: 5
285 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
286 key: someRandomPassword
287
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300288Another way, which also supports multiple swift backends, can be
289configured like this:
Michel Nederlof3a867812017-05-15 09:46:11 +0200290
291.. code-block:: yaml
292
293 glance:
294 server:
295 enabled: true
296 version: mitaka
297 storage:
298 engine: swift,http
299 swift:
300 store:
301 endpoint_type: publicURL
302 container: glance
303 create_container_on_put: true
304 retry_get_count: 5
305 references:
306 my_objectstore_reference_1:
307 auth:
308 address: http://keystone.example.com:5000/v2.0
309 version: 2
310 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
311 key: someRandomPassword
312
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300313Enable CORS parameters:
Ondrej Smolae695fe82017-04-28 12:22:28 +0200314
315.. code-block:: yaml
316
317 glance:
318 server:
319 cors:
320 allowed_origin: https:localhost.local,http:localhost.local
321 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
322 allow_methods: GET,PUT,POST,DELETE,PATCH
323 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
324 allow_credentials: True
325 max_age: 86400
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100326
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200327Enable Viewing Multiple Locations
328---------------------------------
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300329
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200330If you want to expose all locations available (for example when you have
331multiple backends configured), then you can configure this like so:
332
333.. code-block:: yaml
334
335 glance:
336 server:
337 show_multiple_locations: True
338 location_strategy: store_type
339 store_type_preference: rbd,swift,file
340
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300341.. note:: The ``show_multiple_locations`` option is deprecated since
342 Newton and is planned to be handled by policy files *only*
343 starting with the Pike release.
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200344
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300345This feature is convenient in a scenario when you have swift and rbd
346configured and want to benefit from rbd enhancements.
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200347
Oleg Iurchenko68ae3552017-10-13 18:40:42 +0300348Barbican integration glance
349---------------------------
350
351.. code-block:: yaml
352
353 glance:
354 server:
355 barbican:
356 enabled: true
357
sgarbuz2d39f412018-08-27 10:44:31 +0300358Adding cron-job
359---------------
360
361.. code-block:: yaml
362
363 glance:
364 server:
365 cron:
366 cache_pruner:
367 special_period: '@daily'
368 cache_cleaner:
369 hour: '5'
370 minute: '30'
Oleksandr Bryndziif87ae002019-04-24 13:20:57 +0300371 daymonth: '\*/2'
sgarbuz2d39f412018-08-27 10:44:31 +0300372
373
374Image cache settings
375--------------------
376
377.. code-block:: yaml
378
379 glance:
380 server:
381 image_cache:
382 max_size: 10737418240
383 stall_time: 86400
384 directory: '/var/lib/glance/image-cache/'
385
Oleg Iurchenko68ae3552017-10-13 18:40:42 +0300386
Richard Felkl4143a0e2017-02-01 23:24:13 +0100387Client role
388-----------
389
390Glance images
391
392.. code-block:: yaml
393
394 glance:
395 client:
396 enabled: true
397 server:
398 profile_admin:
399 image:
400 cirros-test:
401 visibility: public
402 protected: false
403 location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200404
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400405Enhanced logging with logging.conf
406----------------------------------
407
408By default logging.conf is disabled.
409
410That is possible to enable per-binary logging.conf with new variables:
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400411
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300412* ``openstack_log_appender``
413 Set to true to enable ``log_config_append`` for all OpenStack services
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400414
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300415* ``openstack_fluentd_handler_enabled``
416 Set to true to enable FluentHandler for all Openstack services
417
418* ``openstack_ossyslog_handler_enabled``
419 Set to true to enable OSSysLogHandler for all Openstack services
420
421Only ``WatchedFileHandler``, ``OSSysLogHandler``, and ``FluentHandler``
422are available.
423
424Also, it is possible to configure this with pillar:
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400425
426.. code-block:: yaml
427
428 glance:
429 server:
430 logging:
431 log_appender: true
432 log_handlers:
433 watchedfile:
434 enabled: true
435 fluentd:
436 enabled: true
Oleksii Chupryn90a2e642018-02-06 19:53:06 +0200437 ossyslog:
438 enabled: true
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100439
Oleksandr Shyshko75e3d682018-09-07 14:07:57 +0300440Enable x509 and ssl communication between Glance and Galera cluster.
441---------------------
442By default communication between Glance and Galera is unsecure.
443
444glance:
445 server:
446 database:
447 x509:
448 enabled: True
449
450You able to set custom certificates in pillar:
451
452glance:
453 server:
454 database:
455 x509:
456 cacert: (certificate content)
457 cert: (certificate content)
458 key: (certificate content)
459
460You can read more about it here:
461 https://docs.openstack.org/security-guide/databases/database-access-control.html
462
Oleksandr Bryndziic69e8c82018-09-28 23:27:30 +0000463Glance services on controller node with memcached caching and security strategy:
464
465.. code-block:: yaml
466
467 glance:
468 server:
469 enabled: true
470 ...
471 cache:
472 engine: memcached
473 members:
474 - host: 127.0.0.1
475 port: 11211
476 - host: 127.0.0.1
477 port: 11211
478 security:
479 enabled: true
480 strategy: ENCRYPT
481 secret_key: secret
482
Oleksandr Bryndziidcf245d2018-10-24 19:10:05 +0300483Show all image locations when returning an image. This configuration option indicates
484whether to show all the image locations when returning image details to the user.
485
486.. code-block:: yaml
487
488 glance:
489 server:
490 enabled: true
491 ...
492 show_multiple_locations: True
493
Oleksandr Bryndziif87ae002019-04-24 13:20:57 +0300494Change default resource quotas using configmap template settings
495========
496
497.. code-block:: yaml
498
499 glance:
500 server:
501 configmap:
502 glace_api:
503 DEFAULT:
Oleksandr Bryndziiea82e3d2019-05-15 12:18:30 +0300504 image_member_quota: 128
505 image_property_quota: 128
506 image_tag_quota: 128
507 image_location_quota: 10
508 user_storage_quota: 0
Oleksandr Bryndziif87ae002019-04-24 13:20:57 +0300509 glace_registry:
510 DEFAULT:
Oleksandr Bryndziiea82e3d2019-05-15 12:18:30 +0300511 image_member_quota: 128
512 image_property_quota: 128
513 image_tag_quota: 128
514 image_location_quota: 10
515 user_storage_quota: 0
Oleksandr Bryndziif87ae002019-04-24 13:20:57 +0300516
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100517Usage
518=====
519
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300520#. Import new public image:
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200521
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300522 .. code-block:: yaml
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200523
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100524 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 +0200525
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300526#. Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100527
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300528 .. code-block:: yaml
Petr Michalec86ec0142016-11-29 16:34:15 +0100529
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100530 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100531
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300532#. Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100533
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300534 .. code-block:: yaml
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100535
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100536 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100537
Vasyl Saienko27185832018-09-10 10:36:00 +0000538Upgrades
539========
540
541Each openstack formula provide set of phases (logical bloks) that will help to
542build flexible upgrade orchestration logic for particular components. The list
543of phases and theirs descriptions are listed in table below:
544
545+-------------------------------+------------------------------------------------------+
546| State | Description |
547+===============================+======================================================+
548| <app>.upgrade.service_running | Ensure that all services for particular application |
549| | are enabled for autostart and running |
550+-------------------------------+------------------------------------------------------+
551| <app>.upgrade.service_stopped | Ensure that all services for particular application |
552| | disabled for autostart and dead |
553+-------------------------------+------------------------------------------------------+
554| <app>.upgrade.pkgs_latest | Ensure that packages used by particular application |
555| | are installed to latest available version. |
556| | This will not upgrade data plane packages like qemu |
557| | and openvswitch as usually minimal required version |
558| | in openstack services is really old. The data plane |
559| | packages should be upgraded separately by `apt-get |
560| | upgrade` or `apt-get dist-upgrade` |
561| | Applying this state will not autostart service. |
562+-------------------------------+------------------------------------------------------+
563| <app>.upgrade.render_config | Ensure configuration is rendered actual version. +
564+-------------------------------+------------------------------------------------------+
565| <app>.upgrade.pre | We assume this state is applied on all nodes in the |
566| | cloud before running upgrade. |
567| | Only non destructive actions will be applied during |
568| | this phase. Perform service built in service check |
569| | like (keystone-manage doctor and nova-status upgrade)|
570+-------------------------------+------------------------------------------------------+
571| <app>.upgrade.upgrade.pre | Mostly applicable for data plane nodes. During this |
572| | phase resources will be gracefully removed from |
573| | current node if it is allowed. Services for upgraded |
574| | application will be set to admin disabled state to |
575| | make sure node will not participate in resources |
576| | scheduling. For example on gtw nodes this will set |
577| | all agents to admin disable state and will move all |
578| | routers to other agents. |
579+-------------------------------+------------------------------------------------------+
580| <app>.upgrade.upgrade | This state will basically upgrade application on |
581| | particular target. Stop services, render |
582| | configuration, install new packages, run offline |
583| | dbsync (for ctl), start services. Data plane should |
584| | not be affected, only OpenStack python services. |
585+-------------------------------+------------------------------------------------------+
586| <app>.upgrade.upgrade.post | Add services back to scheduling. |
587+-------------------------------+------------------------------------------------------+
588| <app>.upgrade.post | This phase should be launched only when upgrade of |
589| | the cloud is completed. Cleanup temporary files, |
590| | perform other post upgrade tasks. |
591+-------------------------------+------------------------------------------------------+
592| <app>.upgrade.verify | Here we will do basic health checks (API CRUD |
593| | operations, verify do not have dead network |
594| | agents/compute services) |
595+-------------------------------+------------------------------------------------------+
596
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200597
OlgaGusarenko87eb2842018-07-30 17:51:09 +0300598Read more
599==========
Filip Pytlound681ae22015-10-06 16:28:31 +0200600
601* http://ceph.com/docs/master/rbd/rbd-openstack/