blob: 7439a0202694886a4cb1b4ceee7bdf3a4795faf9 [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
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100340
341Usage
342=====
343
344Import new public image
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200345
346.. code-block:: yaml
347
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100348 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 +0200349
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100350Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100351
352.. code-block:: yaml
353
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100354 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100355
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100356Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100357
358.. code-block:: yaml
359
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100360 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100361
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200362
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100363External links
364==============
Filip Pytlound681ae22015-10-06 16:28:31 +0200365
366* http://ceph.com/docs/master/rbd/rbd-openstack/
367
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100368
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200369Documentation and Bugs
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100370======================
Filip Pytlound681ae22015-10-06 16:28:31 +0200371
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200372To learn how to deploy OpenStack Salt, consult the documentation available
373online at:
374
375 https://wiki.openstack.org/wiki/OpenStackSalt
376
377In the unfortunate event that bugs are discovered, they should be reported to
378the appropriate bug tracker. If you obtained the software from a 3rd party
379operating system vendor, it is often wise to use their own bug tracker for
380reporting problems. In all other cases use the master OpenStack bug tracker,
381available at:
382
383 http://bugs.launchpad.net/openstack-salt
384
385Developers wishing to work on the OpenStack Salt project should always base
386their work on the latest formulas code, available from the master GIT
387repository at:
388
389 https://git.openstack.org/cgit/openstack/salt-formula-glance
390
391Developers should also join the discussion on the IRC list, at:
392
393 https://wiki.openstack.org/wiki/Meetings/openstack-salt
Filip Pytloune94a0a72017-02-02 13:02:03 +0100394
395Documentation and Bugs
396======================
397
398To learn how to install and update salt-formulas, consult the documentation
399available online at:
400
401 http://salt-formulas.readthedocs.io/
402
403In the unfortunate event that bugs are discovered, they should be reported to
404the appropriate issue tracker. Use Github issue tracker for specific salt
405formula:
406
407 https://github.com/salt-formulas/salt-formula-glance/issues
408
409For feature requests, bug reports or blueprints affecting entire ecosystem,
410use Launchpad salt-formulas project:
411
412 https://launchpad.net/salt-formulas
413
414You can also join salt-formulas-users team and subscribe to mailing list:
415
416 https://launchpad.net/~salt-formulas-users
417
418Developers wishing to work on the salt-formulas projects should always base
419their work on master branch and submit pull request against specific formula.
420
421 https://github.com/salt-formulas/salt-formula-glance
422
423Any questions or feedback is always welcome so feel free to join our IRC
424channel:
425
426 #salt-formulas @ irc.freenode.net