blob: 1153f2f42e9b1b2cfec5ea3a33d8d583e2e566c9 [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
Vasyl Saienko83575672018-07-17 18:34:43 +0300112VMWare integration:
113
114.. code-block:: yaml
115
116 glance:
117 server
118 storage:
119 engine: vmware
120 default_store: vsphere
121 vmware:
122 enabled: true
123 server_host: 1.2.3.4
124 server_username: vmware_username
125 server_password: vmware_password
126 datastores:
127 data1:
128 name: datastore_name1
129 enabled: true
130 path: datacenter_name
131 weight: 10
132 data2:
133 name: datastore_name2
134 enabled: true
135 path: datacenter_name
136
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100137RabbitMQ HA setup
138
139.. code-block:: yaml
140
141 glance:
142 server:
143 ....
144 message_queue:
145 engine: rabbitmq
146 members:
147 - host: 10.0.16.1
148 - host: 10.0.16.2
149 - host: 10.0.16.3
150 user: openstack
151 password: pwd
152 virtual_host: '/openstack'
153 ....
154
steluczdf5176a2018-01-17 14:42:11 +0100155Quota Options
156
157.. code-block:: yaml
158
159 glance:
160 server:
161 ....
162 quota:
163 image_member: -1
164 image_property: 256
165 image_tag: 256
166 image_location: 15
167 user_storage: 0
168 ....
169
Kirill Bespalovb5584362017-11-20 16:42:07 +0300170Configuring TLS communications
171------------------------------
Kirill Bespalov365d2432017-07-28 09:01:04 +0300172
Kirill Bespalov365d2432017-07-28 09:01:04 +0300173
Kirill Bespalovb5584362017-11-20 16:42:07 +0300174**Note:** by default system wide installed CA certs are used, so ``cacert_file`` param is optional, as well as ``cacert``.
175
176
177- **RabbitMQ TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300178
179.. code-block:: yaml
180
Kirill Bespalovb5584362017-11-20 16:42:07 +0300181 glance:
182 server:
Kirill Bespalov365d2432017-07-28 09:01:04 +0300183 message_queue:
Kirill Bespalovb5584362017-11-20 16:42:07 +0300184 port: 5671
Kirill Bespalov365d2432017-07-28 09:01:04 +0300185 ssl:
186 enabled: True
Kirill Bespalovb5584362017-11-20 16:42:07 +0300187 (optional) cacert: cert body if the cacert_file does not exists
188 (optional) cacert_file: /etc/openstack/rabbitmq-ca.pem
189 (optional) version: TLSv1_2
Kirill Bespalov365d2432017-07-28 09:01:04 +0300190
191
Kirill Bespalovb5584362017-11-20 16:42:07 +0300192- **MySQL TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300193
194.. code-block:: yaml
195
Kirill Bespalovb5584362017-11-20 16:42:07 +0300196 glance:
197 server:
198 database:
Kirill Bespalov365d2432017-07-28 09:01:04 +0300199 ssl:
200 enabled: True
Kirill Bespalovb5584362017-11-20 16:42:07 +0300201 (optional) cacert: cert body if the cacert_file does not exists
202 (optional) cacert_file: /etc/openstack/mysql-ca.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300203
Kirill Bespalovb5584362017-11-20 16:42:07 +0300204- **Openstack HTTPS API**
205
206
207Set the ``https`` as protocol at ``glance:server`` sections:
Kirill Bespalov365d2432017-07-28 09:01:04 +0300208
209.. code-block:: yaml
210
Kirill Bespalovb5584362017-11-20 16:42:07 +0300211 glance:
212 server:
213 identity:
214 protocol: https
215 (optional) cacert_file: /etc/openstack/proxy.pem
216 registry:
217 protocol: https
218 (optional) cacert_file: /etc/openstack/proxy.pem
219 storage:
220 engine: cinder, swift
221 cinder:
222 protocol: https
223 (optional) cacert_file: /etc/openstack/proxy.pem
224 swift:
225 store:
226 (optional) cafile: /etc/openstack/proxy.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300227
Kirill Bespalov365d2432017-07-28 09:01:04 +0300228
229
mnederlofad6d6242017-03-30 15:31:15 +0200230Enable Glance Image Cache:
231
232.. code-block:: yaml
233
234 glance:
235 server:
236 image_cache:
237 enabled: true
238 enable_management: true
239 directory: /var/lib/glance/image-cache/
240 max_size: 21474836480
241 ....
242
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100243Enable auditing filter (CADF):
244
245.. code-block:: yaml
246
247 glance:
248 server:
249 audit:
250 enabled: true
251 ....
252 filter_factory: 'keystonemiddleware.audit:filter_factory'
253 map_file: '/etc/pycadf/glance_api_audit_map.conf'
254 ....
255
RobertJansen168e84f92017-03-30 15:45:12 +0200256Swift integration glance
257
258.. code-block:: yaml
259
260 glance:
261 server:
262 enabled: true
263 version: mitaka
264 storage:
265 engine: swift,http
266 swift:
267 store:
268 auth:
269 address: http://keystone.example.com:5000/v2.0
270 version: 2
271 endpoint_type: publicURL
272 container: glance
273 create_container_on_put: true
274 retry_get_count: 5
275 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
276 key: someRandomPassword
277
Michel Nederlof3a867812017-05-15 09:46:11 +0200278Another way, which also supports multiple swift backends, can be configured like this:
279
280.. code-block:: yaml
281
282 glance:
283 server:
284 enabled: true
285 version: mitaka
286 storage:
287 engine: swift,http
288 swift:
289 store:
290 endpoint_type: publicURL
291 container: glance
292 create_container_on_put: true
293 retry_get_count: 5
294 references:
295 my_objectstore_reference_1:
296 auth:
297 address: http://keystone.example.com:5000/v2.0
298 version: 2
299 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
300 key: someRandomPassword
301
Ondrej Smolae695fe82017-04-28 12:22:28 +0200302Enable CORS parameters
303
304.. code-block:: yaml
305
306 glance:
307 server:
308 cors:
309 allowed_origin: https:localhost.local,http:localhost.local
310 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
311 allow_methods: GET,PUT,POST,DELETE,PATCH
312 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
313 allow_credentials: True
314 max_age: 86400
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100315
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200316Enable Viewing Multiple Locations
317---------------------------------
318If you want to expose all locations available (for example when you have
319multiple backends configured), then you can configure this like so:
320
321.. code-block:: yaml
322
323 glance:
324 server:
325 show_multiple_locations: True
326 location_strategy: store_type
327 store_type_preference: rbd,swift,file
328
329Please note: the show_multiple_locations option is deprecated since Newton and is planned
330 to be handled by policy files _only_ starting with the Pike release.
331
332This feature is convenient in a scenario when you have swift and rbd configured and want to
333benefit from rbd enhancements.
334
335
Oleg Iurchenko68ae3552017-10-13 18:40:42 +0300336Barbican integration glance
337---------------------------
338
339.. code-block:: yaml
340
341 glance:
342 server:
343 barbican:
344 enabled: true
345
346
Richard Felkl4143a0e2017-02-01 23:24:13 +0100347Client role
348-----------
349
350Glance images
351
352.. code-block:: yaml
353
354 glance:
355 client:
356 enabled: true
357 server:
358 profile_admin:
359 image:
360 cirros-test:
361 visibility: public
362 protected: false
363 location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200364
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400365Enhanced logging with logging.conf
366----------------------------------
367
368By default logging.conf is disabled.
369
370That is possible to enable per-binary logging.conf with new variables:
371 * openstack_log_appender - set it to true to enable log_config_append for all OpenStack services;
372 * openstack_fluentd_handler_enabled - set to true to enable FluentHandler for all Openstack services.
Oleksii Chupryn90a2e642018-02-06 19:53:06 +0200373 * openstack_ossyslog_handler_enabled - set to true to enable OSSysLogHandler for all Openstack services.
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400374
Oleksii Chupryn90a2e642018-02-06 19:53:06 +0200375Only WatchedFileHandler, OSSysLogHandler and FluentHandler are available.
Dmitry Kalashnikdd0d0282017-12-06 12:45:31 +0400376
377Also it is possible to configure this with pillar:
378
379.. code-block:: yaml
380
381 glance:
382 server:
383 logging:
384 log_appender: true
385 log_handlers:
386 watchedfile:
387 enabled: true
388 fluentd:
389 enabled: true
Oleksii Chupryn90a2e642018-02-06 19:53:06 +0200390 ossyslog:
391 enabled: true
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100392
393Usage
394=====
395
396Import new public image
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200397
398.. code-block:: yaml
399
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100400 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 +0200401
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100402Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100403
404.. code-block:: yaml
405
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100406 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100407
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100408Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100409
410.. code-block:: yaml
411
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100412 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100413
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200414
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100415External links
416==============
Filip Pytlound681ae22015-10-06 16:28:31 +0200417
418* http://ceph.com/docs/master/rbd/rbd-openstack/
419
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100420
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200421Documentation and Bugs
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100422======================
Filip Pytlound681ae22015-10-06 16:28:31 +0200423
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200424To learn how to deploy OpenStack Salt, consult the documentation available
425online at:
426
427 https://wiki.openstack.org/wiki/OpenStackSalt
428
429In the unfortunate event that bugs are discovered, they should be reported to
430the appropriate bug tracker. If you obtained the software from a 3rd party
431operating system vendor, it is often wise to use their own bug tracker for
432reporting problems. In all other cases use the master OpenStack bug tracker,
433available at:
434
435 http://bugs.launchpad.net/openstack-salt
436
437Developers wishing to work on the OpenStack Salt project should always base
438their work on the latest formulas code, available from the master GIT
439repository at:
440
441 https://git.openstack.org/cgit/openstack/salt-formula-glance
442
443Developers should also join the discussion on the IRC list, at:
444
445 https://wiki.openstack.org/wiki/Meetings/openstack-salt
Filip Pytloune94a0a72017-02-02 13:02:03 +0100446
447Documentation and Bugs
448======================
449
450To learn how to install and update salt-formulas, consult the documentation
451available online at:
452
453 http://salt-formulas.readthedocs.io/
454
455In the unfortunate event that bugs are discovered, they should be reported to
456the appropriate issue tracker. Use Github issue tracker for specific salt
457formula:
458
459 https://github.com/salt-formulas/salt-formula-glance/issues
460
461For feature requests, bug reports or blueprints affecting entire ecosystem,
462use Launchpad salt-formulas project:
463
464 https://launchpad.net/salt-formulas
465
466You can also join salt-formulas-users team and subscribe to mailing list:
467
468 https://launchpad.net/~salt-formulas-users
469
470Developers wishing to work on the salt-formulas projects should always base
471their work on master branch and submit pull request against specific formula.
472
473 https://github.com/salt-formulas/salt-formula-glance
474
475Any questions or feedback is always welcome so feel free to join our IRC
476channel:
477
478 #salt-formulas @ irc.freenode.net