blob: 415c31f866ed0ba15c439add494c15bfac0fa315 [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
Kirill Bespalovb5584362017-11-20 16:42:07 +0300130Configuring TLS communications
131------------------------------
Kirill Bespalov365d2432017-07-28 09:01:04 +0300132
Kirill Bespalov365d2432017-07-28 09:01:04 +0300133
Kirill Bespalovb5584362017-11-20 16:42:07 +0300134**Note:** by default system wide installed CA certs are used, so ``cacert_file`` param is optional, as well as ``cacert``.
135
136
137- **RabbitMQ TLS**
Kirill Bespalov365d2432017-07-28 09:01:04 +0300138
139.. code-block:: yaml
140
Kirill Bespalovb5584362017-11-20 16:42:07 +0300141 glance:
142 server:
Kirill Bespalov365d2432017-07-28 09:01:04 +0300143 message_queue:
Kirill Bespalovb5584362017-11-20 16:42:07 +0300144 port: 5671
Kirill Bespalov365d2432017-07-28 09:01:04 +0300145 ssl:
146 enabled: True
Kirill Bespalovb5584362017-11-20 16:42:07 +0300147 (optional) cacert: cert body if the cacert_file does not exists
148 (optional) cacert_file: /etc/openstack/rabbitmq-ca.pem
149 (optional) version: TLSv1_2
Kirill Bespalov365d2432017-07-28 09:01:04 +0300150
151
Kirill Bespalovb5584362017-11-20 16:42:07 +0300152- **MySQL 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:
158 database:
Kirill Bespalov365d2432017-07-28 09:01:04 +0300159 ssl:
160 enabled: True
Kirill Bespalovb5584362017-11-20 16:42:07 +0300161 (optional) cacert: cert body if the cacert_file does not exists
162 (optional) cacert_file: /etc/openstack/mysql-ca.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300163
Kirill Bespalovb5584362017-11-20 16:42:07 +0300164- **Openstack HTTPS API**
165
166
167Set the ``https`` as protocol at ``glance:server`` sections:
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 identity:
174 protocol: https
175 (optional) cacert_file: /etc/openstack/proxy.pem
176 registry:
177 protocol: https
178 (optional) cacert_file: /etc/openstack/proxy.pem
179 storage:
180 engine: cinder, swift
181 cinder:
182 protocol: https
183 (optional) cacert_file: /etc/openstack/proxy.pem
184 swift:
185 store:
186 (optional) cafile: /etc/openstack/proxy.pem
Kirill Bespalov365d2432017-07-28 09:01:04 +0300187
Kirill Bespalov365d2432017-07-28 09:01:04 +0300188
189
mnederlofad6d6242017-03-30 15:31:15 +0200190Enable Glance Image Cache:
191
192.. code-block:: yaml
193
194 glance:
195 server:
196 image_cache:
197 enabled: true
198 enable_management: true
199 directory: /var/lib/glance/image-cache/
200 max_size: 21474836480
201 ....
202
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100203Enable auditing filter (CADF):
204
205.. code-block:: yaml
206
207 glance:
208 server:
209 audit:
210 enabled: true
211 ....
212 filter_factory: 'keystonemiddleware.audit:filter_factory'
213 map_file: '/etc/pycadf/glance_api_audit_map.conf'
214 ....
215
RobertJansen168e84f92017-03-30 15:45:12 +0200216Swift integration glance
217
218.. code-block:: yaml
219
220 glance:
221 server:
222 enabled: true
223 version: mitaka
224 storage:
225 engine: swift,http
226 swift:
227 store:
228 auth:
229 address: http://keystone.example.com:5000/v2.0
230 version: 2
231 endpoint_type: publicURL
232 container: glance
233 create_container_on_put: true
234 retry_get_count: 5
235 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
236 key: someRandomPassword
237
Michel Nederlof3a867812017-05-15 09:46:11 +0200238Another way, which also supports multiple swift backends, can be configured like this:
239
240.. code-block:: yaml
241
242 glance:
243 server:
244 enabled: true
245 version: mitaka
246 storage:
247 engine: swift,http
248 swift:
249 store:
250 endpoint_type: publicURL
251 container: glance
252 create_container_on_put: true
253 retry_get_count: 5
254 references:
255 my_objectstore_reference_1:
256 auth:
257 address: http://keystone.example.com:5000/v2.0
258 version: 2
259 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
260 key: someRandomPassword
261
Ondrej Smolae695fe82017-04-28 12:22:28 +0200262Enable CORS parameters
263
264.. code-block:: yaml
265
266 glance:
267 server:
268 cors:
269 allowed_origin: https:localhost.local,http:localhost.local
270 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
271 allow_methods: GET,PUT,POST,DELETE,PATCH
272 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
273 allow_credentials: True
274 max_age: 86400
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100275
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200276Enable Viewing Multiple Locations
277---------------------------------
278If you want to expose all locations available (for example when you have
279multiple backends configured), then you can configure this like so:
280
281.. code-block:: yaml
282
283 glance:
284 server:
285 show_multiple_locations: True
286 location_strategy: store_type
287 store_type_preference: rbd,swift,file
288
289Please note: the show_multiple_locations option is deprecated since Newton and is planned
290 to be handled by policy files _only_ starting with the Pike release.
291
292This feature is convenient in a scenario when you have swift and rbd configured and want to
293benefit from rbd enhancements.
294
295
Oleg Iurchenko68ae3552017-10-13 18:40:42 +0300296Barbican integration glance
297---------------------------
298
299.. code-block:: yaml
300
301 glance:
302 server:
303 barbican:
304 enabled: true
305
306
Richard Felkl4143a0e2017-02-01 23:24:13 +0100307Client role
308-----------
309
310Glance images
311
312.. code-block:: yaml
313
314 glance:
315 client:
316 enabled: true
317 server:
318 profile_admin:
319 image:
320 cirros-test:
321 visibility: public
322 protected: false
323 location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200324
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100325
326Usage
327=====
328
329Import new public image
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200330
331.. code-block:: yaml
332
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100333 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 +0200334
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100335Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100336
337.. code-block:: yaml
338
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100339 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100340
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100341Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100342
343.. code-block:: yaml
344
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100345 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100346
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200347
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100348External links
349==============
Filip Pytlound681ae22015-10-06 16:28:31 +0200350
351* http://ceph.com/docs/master/rbd/rbd-openstack/
352
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100353
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200354Documentation and Bugs
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100355======================
Filip Pytlound681ae22015-10-06 16:28:31 +0200356
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200357To learn how to deploy OpenStack Salt, consult the documentation available
358online at:
359
360 https://wiki.openstack.org/wiki/OpenStackSalt
361
362In the unfortunate event that bugs are discovered, they should be reported to
363the appropriate bug tracker. If you obtained the software from a 3rd party
364operating system vendor, it is often wise to use their own bug tracker for
365reporting problems. In all other cases use the master OpenStack bug tracker,
366available at:
367
368 http://bugs.launchpad.net/openstack-salt
369
370Developers wishing to work on the OpenStack Salt project should always base
371their work on the latest formulas code, available from the master GIT
372repository at:
373
374 https://git.openstack.org/cgit/openstack/salt-formula-glance
375
376Developers should also join the discussion on the IRC list, at:
377
378 https://wiki.openstack.org/wiki/Meetings/openstack-salt
Filip Pytloune94a0a72017-02-02 13:02:03 +0100379
380Documentation and Bugs
381======================
382
383To learn how to install and update salt-formulas, consult the documentation
384available online at:
385
386 http://salt-formulas.readthedocs.io/
387
388In the unfortunate event that bugs are discovered, they should be reported to
389the appropriate issue tracker. Use Github issue tracker for specific salt
390formula:
391
392 https://github.com/salt-formulas/salt-formula-glance/issues
393
394For feature requests, bug reports or blueprints affecting entire ecosystem,
395use Launchpad salt-formulas project:
396
397 https://launchpad.net/salt-formulas
398
399You can also join salt-formulas-users team and subscribe to mailing list:
400
401 https://launchpad.net/~salt-formulas-users
402
403Developers wishing to work on the salt-formulas projects should always base
404their work on master branch and submit pull request against specific formula.
405
406 https://github.com/salt-formulas/salt-formula-glance
407
408Any questions or feedback is always welcome so feel free to join our IRC
409channel:
410
411 #salt-formulas @ irc.freenode.net