blob: 02da35db7d356b9d1122e4f8c9fcdd1b86319d0c [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 Bespalov365d2432017-07-28 09:01:04 +0300130Client-side RabbitMQ TLS configuration:
131---------------------------------------
132
133To enable TLS for oslo.messaging you need to provide the CA certificate.
134
135By default system-wide CA certs are used. Nothing should be specified except `ssl.enabled`.
136
137.. code-block:: yaml
138
139 glance:
140 server:
141 ....
142 message_queue:
143 ssl:
144 enabled: True
145
146
147
148Use `cacert_file` option to specify the CA-cert file path explicitly:
149
150.. code-block:: yaml
151
152 glance:
153 server:
154 ....
155 message_queue:
156 ssl:
157 enabled: True
158 cacert_file: /etc/ssl/rabbitmq-ca.pem
159
160To manage content of the `cacert_file` use the `cacert` option:
161
162.. code-block:: yaml
163
164 glance:
165 server:
166 ....
167 message_queue:
168 ssl:
169 enabled: True
170 cacert: |
171
172 -----BEGIN CERTIFICATE-----
173 ...
174 -----END CERTIFICATE-------
175
176 cacert_file: /etc/openstack/rabbitmq-ca.pem
177
178
179Notice:
180 * The `message_queue.port` is set to **5671** (AMQPS) by default if `ssl.enabled=True`.
181 * Use `message_queue.ssl.version` if you need to specify protocol version. By default is TLSv1 for python < 2.7.9 and TLSv1_2 for version above.
182
183
mnederlofad6d6242017-03-30 15:31:15 +0200184Enable Glance Image Cache:
185
186.. code-block:: yaml
187
188 glance:
189 server:
190 image_cache:
191 enabled: true
192 enable_management: true
193 directory: /var/lib/glance/image-cache/
194 max_size: 21474836480
195 ....
196
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100197Enable auditing filter (CADF):
198
199.. code-block:: yaml
200
201 glance:
202 server:
203 audit:
204 enabled: true
205 ....
206 filter_factory: 'keystonemiddleware.audit:filter_factory'
207 map_file: '/etc/pycadf/glance_api_audit_map.conf'
208 ....
209
RobertJansen168e84f92017-03-30 15:45:12 +0200210Swift integration glance
211
212.. code-block:: yaml
213
214 glance:
215 server:
216 enabled: true
217 version: mitaka
218 storage:
219 engine: swift,http
220 swift:
221 store:
222 auth:
223 address: http://keystone.example.com:5000/v2.0
224 version: 2
225 endpoint_type: publicURL
226 container: glance
227 create_container_on_put: true
228 retry_get_count: 5
229 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
230 key: someRandomPassword
231
Michel Nederlof3a867812017-05-15 09:46:11 +0200232Another way, which also supports multiple swift backends, can be configured like this:
233
234.. code-block:: yaml
235
236 glance:
237 server:
238 enabled: true
239 version: mitaka
240 storage:
241 engine: swift,http
242 swift:
243 store:
244 endpoint_type: publicURL
245 container: glance
246 create_container_on_put: true
247 retry_get_count: 5
248 references:
249 my_objectstore_reference_1:
250 auth:
251 address: http://keystone.example.com:5000/v2.0
252 version: 2
253 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
254 key: someRandomPassword
255
Ondrej Smolae695fe82017-04-28 12:22:28 +0200256Enable CORS parameters
257
258.. code-block:: yaml
259
260 glance:
261 server:
262 cors:
263 allowed_origin: https:localhost.local,http:localhost.local
264 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
265 allow_methods: GET,PUT,POST,DELETE,PATCH
266 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
267 allow_credentials: True
268 max_age: 86400
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100269
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200270Enable Viewing Multiple Locations
271---------------------------------
272If you want to expose all locations available (for example when you have
273multiple backends configured), then you can configure this like so:
274
275.. code-block:: yaml
276
277 glance:
278 server:
279 show_multiple_locations: True
280 location_strategy: store_type
281 store_type_preference: rbd,swift,file
282
283Please note: the show_multiple_locations option is deprecated since Newton and is planned
284 to be handled by policy files _only_ starting with the Pike release.
285
286This feature is convenient in a scenario when you have swift and rbd configured and want to
287benefit from rbd enhancements.
288
289
Oleg Iurchenko68ae3552017-10-13 18:40:42 +0300290Barbican integration glance
291---------------------------
292
293.. code-block:: yaml
294
295 glance:
296 server:
297 barbican:
298 enabled: true
299
300
Richard Felkl4143a0e2017-02-01 23:24:13 +0100301Client role
302-----------
303
304Glance images
305
306.. code-block:: yaml
307
308 glance:
309 client:
310 enabled: true
311 server:
312 profile_admin:
313 image:
314 cirros-test:
315 visibility: public
316 protected: false
317 location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200318
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100319
320Usage
321=====
322
323Import new public image
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200324
325.. code-block:: yaml
326
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100327 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 +0200328
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100329Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100330
331.. code-block:: yaml
332
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100333 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100334
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100335Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100336
337.. code-block:: yaml
338
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100339 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100340
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200341
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100342External links
343==============
Filip Pytlound681ae22015-10-06 16:28:31 +0200344
345* http://ceph.com/docs/master/rbd/rbd-openstack/
346
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100347
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200348Documentation and Bugs
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100349======================
Filip Pytlound681ae22015-10-06 16:28:31 +0200350
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200351To learn how to deploy OpenStack Salt, consult the documentation available
352online at:
353
354 https://wiki.openstack.org/wiki/OpenStackSalt
355
356In the unfortunate event that bugs are discovered, they should be reported to
357the appropriate bug tracker. If you obtained the software from a 3rd party
358operating system vendor, it is often wise to use their own bug tracker for
359reporting problems. In all other cases use the master OpenStack bug tracker,
360available at:
361
362 http://bugs.launchpad.net/openstack-salt
363
364Developers wishing to work on the OpenStack Salt project should always base
365their work on the latest formulas code, available from the master GIT
366repository at:
367
368 https://git.openstack.org/cgit/openstack/salt-formula-glance
369
370Developers should also join the discussion on the IRC list, at:
371
372 https://wiki.openstack.org/wiki/Meetings/openstack-salt
Filip Pytloune94a0a72017-02-02 13:02:03 +0100373
374Documentation and Bugs
375======================
376
377To learn how to install and update salt-formulas, consult the documentation
378available online at:
379
380 http://salt-formulas.readthedocs.io/
381
382In the unfortunate event that bugs are discovered, they should be reported to
383the appropriate issue tracker. Use Github issue tracker for specific salt
384formula:
385
386 https://github.com/salt-formulas/salt-formula-glance/issues
387
388For feature requests, bug reports or blueprints affecting entire ecosystem,
389use Launchpad salt-formulas project:
390
391 https://launchpad.net/salt-formulas
392
393You can also join salt-formulas-users team and subscribe to mailing list:
394
395 https://launchpad.net/~salt-formulas-users
396
397Developers wishing to work on the salt-formulas projects should always base
398their work on master branch and submit pull request against specific formula.
399
400 https://github.com/salt-formulas/salt-formula-glance
401
402Any questions or feedback is always welcome so feel free to join our IRC
403channel:
404
405 #salt-formulas @ irc.freenode.net