blob: 2a6206f96b455b6b30b72a69f41fabdbbdcddede [file] [log] [blame]
Aleš Komáreke5b388f2017-02-06 15:48:57 +01001==============
2Glance formula
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
Filip Pytlound681ae22015-10-06 16:28:31 +02009
Aleš Komáreke5b388f2017-02-06 15:48:57 +010010Sample pillars
11==============
Filip Pytlound681ae22015-10-06 16:28:31 +020012
13.. code-block:: yaml
14
15 glance:
16 server:
17 enabled: true
18 version: juno
Alena Holanovac1e51312016-03-22 14:08:44 +010019 workers: 8
Dmitry Stremkovskiye9490cf2017-07-11 11:37:44 +030020 glance_uid: 302
21 glance_gid: 302
Filip Pytlound681ae22015-10-06 16:28:31 +020022 policy:
23 publicize_image:
24 - "role:admin"
25 - "role:image_manager"
26 database:
27 engine: mysql
28 host: 127.0.0.1
29 port: 3306
30 name: glance
31 user: glance
32 password: pwd
33 identity:
34 engine: keystone
35 host: 127.0.0.1
36 port: 35357
37 tenant: service
38 user: glance
39 password: pwd
40 message_queue:
41 engine: rabbitmq
42 host: 127.0.0.1
43 port: 5672
44 user: openstack
45 password: pwd
46 virtual_host: '/openstack'
47 storage:
48 engine: file
49 images:
50 - name: "CirrOS 0.3.1"
51 format: qcow2
52 file: cirros-0.3.1-x86_64-disk.img
53 source: http://cdn.download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img
54 public: true
Petr Michalec86ec0142016-11-29 16:34:15 +010055 audit:
56 enabled: false
Simon Pasquier2acbef52017-02-03 15:09:39 +010057 api_limit_max: 100
58 limit_param_default: 50
Oleg Iurchenko68ae3552017-10-13 18:40:42 +030059 barbican:
60 enabled: true
Simon Pasquier2acbef52017-02-03 15:09:39 +010061
62The pagination is controlled by the *api_limit_max* and *limit_param_default*
63parameters as shown above:
64
65* *api_limit_max* defines the maximum number of records that the server will
66 return.
67
68* *limit_param_default* is the default *limit* parameter that
69 applies if the request didn't defined it explicitly.
Filip Pytlound681ae22015-10-06 16:28:31 +020070
Dmitry Ukov0a228ad2017-05-15 13:35:43 +040071Configuration of policy.json file
72
73.. code-block:: yaml
74
75 glance:
76 server:
77 ....
78 policy:
79 publicize_image: "role:admin"
80 # Add key without value to remove line from policy.json
81 add_member:
Aleš Komáreke5b388f2017-02-06 15:48:57 +010082Keystone and cinder region
83
84.. code-block:: yaml
85
86 glance:
87 server:
88 enabled: true
89 version: kilo
90 ...
91 identity:
92 engine: keystone
93 host: 127.0.0.1
94 region: RegionTwo
95 ...
96
97Ceph integration glance
98
99.. code-block:: yaml
100
101 glance:
102 server:
103 enabled: true
104 version: juno
105 storage:
106 engine: rbd,http
107 user: glance
108 pool: images
109 chunk_size: 8
110 client_glance_key: AQDOavlU6BsSJhAAnpFR906mvdgdfRqLHwu0Uw==
111
112RabbitMQ HA setup
113
114.. code-block:: yaml
115
116 glance:
117 server:
118 ....
119 message_queue:
120 engine: rabbitmq
121 members:
122 - host: 10.0.16.1
123 - host: 10.0.16.2
124 - host: 10.0.16.3
125 user: openstack
126 password: pwd
127 virtual_host: '/openstack'
128 ....
129
steluczdf5176a2018-01-17 14:42:11 +0100130Quota Options
131
132.. code-block:: yaml
133
134 glance:
135 server:
136 ....
137 quota:
138 image_member: -1
139 image_property: 256
140 image_tag: 256
141 image_location: 15
142 user_storage: 0
143 ....
144
Kirill Bespalovb5584362017-11-20 16:42:07 +0300145Configuring TLS communications
146------------------------------
Kirill Bespalov365d2432017-07-28 09:01:04 +0300147
Kirill Bespalov365d2432017-07-28 09:01:04 +0300148
Kirill Bespalovb5584362017-11-20 16:42:07 +0300149**Note:** by default system wide installed CA certs are used, so ``cacert_file`` param is optional, as well as ``cacert``.
150
151
152- **RabbitMQ TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300153
154.. code-block:: yaml
155
Kirill Bespalovb5584362017-11-20 16:42:07 +0300156 glance:
157 server:
Kirill Bespalov365d2432017-07-28 09:01:04 +0300158 message_queue:
Kirill Bespalovb5584362017-11-20 16:42:07 +0300159 port: 5671
Kirill Bespalov365d2432017-07-28 09:01:04 +0300160 ssl:
161 enabled: True
Kirill Bespalovb5584362017-11-20 16:42:07 +0300162 (optional) cacert: cert body if the cacert_file does not exists
163 (optional) cacert_file: /etc/openstack/rabbitmq-ca.pem
164 (optional) version: TLSv1_2
Kirill Bespalov365d2432017-07-28 09:01:04 +0300165
166
Kirill Bespalovb5584362017-11-20 16:42:07 +0300167- **MySQL TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300168
169.. code-block:: yaml
170
Kirill Bespalovb5584362017-11-20 16:42:07 +0300171 glance:
172 server:
173 database:
Kirill Bespalov365d2432017-07-28 09:01:04 +0300174 ssl:
175 enabled: True
Kirill Bespalovb5584362017-11-20 16:42:07 +0300176 (optional) cacert: cert body if the cacert_file does not exists
177 (optional) cacert_file: /etc/openstack/mysql-ca.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300178
Kirill Bespalovb5584362017-11-20 16:42:07 +0300179- **Openstack HTTPS API**
180
181
182Set the ``https`` as protocol at ``glance:server`` sections:
Kirill Bespalov365d2432017-07-28 09:01:04 +0300183
184.. code-block:: yaml
185
Kirill Bespalovb5584362017-11-20 16:42:07 +0300186 glance:
187 server:
188 identity:
189 protocol: https
190 (optional) cacert_file: /etc/openstack/proxy.pem
191 registry:
192 protocol: https
193 (optional) cacert_file: /etc/openstack/proxy.pem
194 storage:
195 engine: cinder, swift
196 cinder:
197 protocol: https
198 (optional) cacert_file: /etc/openstack/proxy.pem
199 swift:
200 store:
201 (optional) cafile: /etc/openstack/proxy.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300202
Kirill Bespalov365d2432017-07-28 09:01:04 +0300203
204
mnederlofad6d6242017-03-30 15:31:15 +0200205Enable Glance Image Cache:
206
207.. code-block:: yaml
208
209 glance:
210 server:
211 image_cache:
212 enabled: true
213 enable_management: true
214 directory: /var/lib/glance/image-cache/
215 max_size: 21474836480
216 ....
217
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100218Enable auditing filter (CADF):
219
220.. code-block:: yaml
221
222 glance:
223 server:
224 audit:
225 enabled: true
226 ....
227 filter_factory: 'keystonemiddleware.audit:filter_factory'
228 map_file: '/etc/pycadf/glance_api_audit_map.conf'
229 ....
230
RobertJansen168e84f92017-03-30 15:45:12 +0200231Swift integration glance
232
233.. code-block:: yaml
234
235 glance:
236 server:
237 enabled: true
238 version: mitaka
239 storage:
240 engine: swift,http
241 swift:
242 store:
243 auth:
244 address: http://keystone.example.com:5000/v2.0
245 version: 2
246 endpoint_type: publicURL
247 container: glance
248 create_container_on_put: true
249 retry_get_count: 5
250 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
251 key: someRandomPassword
252
Michel Nederlof3a867812017-05-15 09:46:11 +0200253Another way, which also supports multiple swift backends, can be configured like this:
254
255.. code-block:: yaml
256
257 glance:
258 server:
259 enabled: true
260 version: mitaka
261 storage:
262 engine: swift,http
263 swift:
264 store:
265 endpoint_type: publicURL
266 container: glance
267 create_container_on_put: true
268 retry_get_count: 5
269 references:
270 my_objectstore_reference_1:
271 auth:
272 address: http://keystone.example.com:5000/v2.0
273 version: 2
274 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
275 key: someRandomPassword
276
Ondrej Smolae695fe82017-04-28 12:22:28 +0200277Enable CORS parameters
278
279.. code-block:: yaml
280
281 glance:
282 server:
283 cors:
284 allowed_origin: https:localhost.local,http:localhost.local
285 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
286 allow_methods: GET,PUT,POST,DELETE,PATCH
287 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
288 allow_credentials: True
289 max_age: 86400
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100290
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200291Enable Viewing Multiple Locations
292---------------------------------
293If you want to expose all locations available (for example when you have
294multiple backends configured), then you can configure this like so:
295
296.. code-block:: yaml
297
298 glance:
299 server:
300 show_multiple_locations: True
301 location_strategy: store_type
302 store_type_preference: rbd,swift,file
303
304Please note: the show_multiple_locations option is deprecated since Newton and is planned
305 to be handled by policy files _only_ starting with the Pike release.
306
307This feature is convenient in a scenario when you have swift and rbd configured and want to
308benefit from rbd enhancements.
309
310
Oleg Iurchenko68ae3552017-10-13 18:40:42 +0300311Barbican integration glance
312---------------------------
313
314.. code-block:: yaml
315
316 glance:
317 server:
318 barbican:
319 enabled: true
320
321
Richard Felkl4143a0e2017-02-01 23:24:13 +0100322Client role
323-----------
324
325Glance images
326
327.. code-block:: yaml
328
329 glance:
330 client:
331 enabled: true
332 server:
333 profile_admin:
334 image:
335 cirros-test:
336 visibility: public
337 protected: false
338 location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200339
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400340Enhanced logging with logging.conf
341----------------------------------
342
343By default logging.conf is disabled.
344
345That is possible to enable per-binary logging.conf with new variables:
346 * openstack_log_appender - set it to true to enable log_config_append for all OpenStack services;
347 * openstack_fluentd_handler_enabled - set to true to enable FluentHandler for all Openstack services.
Oleksii Chupryn90a2e642018-02-06 19:53:06 +0200348 * openstack_ossyslog_handler_enabled - set to true to enable OSSysLogHandler for all Openstack services.
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400349
Oleksii Chupryn90a2e642018-02-06 19:53:06 +0200350Only WatchedFileHandler, OSSysLogHandler and FluentHandler are available.
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400351
352Also it is possible to configure this with pillar:
353
354.. code-block:: yaml
355
356 glance:
357 server:
358 logging:
359 log_appender: true
360 log_handlers:
361 watchedfile:
362 enabled: true
363 fluentd:
364 enabled: true
Oleksii Chupryn90a2e642018-02-06 19:53:06 +0200365 ossyslog:
366 enabled: true
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100367
368Usage
369=====
370
371Import new public image
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200372
373.. code-block:: yaml
374
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100375 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 +0200376
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100377Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100378
379.. code-block:: yaml
380
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100381 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100382
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100383Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100384
385.. code-block:: yaml
386
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100387 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100388
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200389
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100390External links
391==============
Filip Pytlound681ae22015-10-06 16:28:31 +0200392
393* http://ceph.com/docs/master/rbd/rbd-openstack/
394
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100395
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200396Documentation and Bugs
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100397======================
Filip Pytlound681ae22015-10-06 16:28:31 +0200398
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200399To learn how to deploy OpenStack Salt, consult the documentation available
400online at:
401
402 https://wiki.openstack.org/wiki/OpenStackSalt
403
404In the unfortunate event that bugs are discovered, they should be reported to
405the appropriate bug tracker. If you obtained the software from a 3rd party
406operating system vendor, it is often wise to use their own bug tracker for
407reporting problems. In all other cases use the master OpenStack bug tracker,
408available at:
409
410 http://bugs.launchpad.net/openstack-salt
411
412Developers wishing to work on the OpenStack Salt project should always base
413their work on the latest formulas code, available from the master GIT
414repository at:
415
416 https://git.openstack.org/cgit/openstack/salt-formula-glance
417
418Developers should also join the discussion on the IRC list, at:
419
420 https://wiki.openstack.org/wiki/Meetings/openstack-salt
Filip Pytloune94a0a72017-02-02 13:02:03 +0100421
422Documentation and Bugs
423======================
424
425To learn how to install and update salt-formulas, consult the documentation
426available online at:
427
428 http://salt-formulas.readthedocs.io/
429
430In the unfortunate event that bugs are discovered, they should be reported to
431the appropriate issue tracker. Use Github issue tracker for specific salt
432formula:
433
434 https://github.com/salt-formulas/salt-formula-glance/issues
435
436For feature requests, bug reports or blueprints affecting entire ecosystem,
437use Launchpad salt-formulas project:
438
439 https://launchpad.net/salt-formulas
440
441You can also join salt-formulas-users team and subscribe to mailing list:
442
443 https://launchpad.net/~salt-formulas-users
444
445Developers wishing to work on the salt-formulas projects should always base
446their work on master branch and submit pull request against specific formula.
447
448 https://github.com/salt-formulas/salt-formula-glance
449
450Any questions or feedback is always welcome so feel free to join our IRC
451channel:
452
453 #salt-formulas @ irc.freenode.net