blob: af03680c6286e40a8f3f1da271a72cf3221c83f0 [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
59
60The pagination is controlled by the *api_limit_max* and *limit_param_default*
61parameters as shown above:
62
63* *api_limit_max* defines the maximum number of records that the server will
64 return.
65
66* *limit_param_default* is the default *limit* parameter that
67 applies if the request didn't defined it explicitly.
Filip Pytlound681ae22015-10-06 16:28:31 +020068
Dmitry Ukov0a228ad2017-05-15 13:35:43 +040069Configuration of policy.json file
70
71.. code-block:: yaml
72
73 glance:
74 server:
75 ....
76 policy:
77 publicize_image: "role:admin"
78 # Add key without value to remove line from policy.json
79 add_member:
Aleš Komáreke5b388f2017-02-06 15:48:57 +010080Keystone and cinder region
81
82.. code-block:: yaml
83
84 glance:
85 server:
86 enabled: true
87 version: kilo
88 ...
89 identity:
90 engine: keystone
91 host: 127.0.0.1
92 region: RegionTwo
93 ...
94
95Ceph integration glance
96
97.. code-block:: yaml
98
99 glance:
100 server:
101 enabled: true
102 version: juno
103 storage:
104 engine: rbd,http
105 user: glance
106 pool: images
107 chunk_size: 8
108 client_glance_key: AQDOavlU6BsSJhAAnpFR906mvdgdfRqLHwu0Uw==
109
110RabbitMQ HA setup
111
112.. code-block:: yaml
113
114 glance:
115 server:
116 ....
117 message_queue:
118 engine: rabbitmq
119 members:
120 - host: 10.0.16.1
121 - host: 10.0.16.2
122 - host: 10.0.16.3
123 user: openstack
124 password: pwd
125 virtual_host: '/openstack'
126 ....
127
Kirill Bespalov365d2432017-07-28 09:01:04 +0300128Client-side RabbitMQ TLS configuration:
129---------------------------------------
130
131To enable TLS for oslo.messaging you need to provide the CA certificate.
132
133By default system-wide CA certs are used. Nothing should be specified except `ssl.enabled`.
134
135.. code-block:: yaml
136
137 glance:
138 server:
139 ....
140 message_queue:
141 ssl:
142 enabled: True
143
144
145
146Use `cacert_file` option to specify the CA-cert file path explicitly:
147
148.. code-block:: yaml
149
150 glance:
151 server:
152 ....
153 message_queue:
154 ssl:
155 enabled: True
156 cacert_file: /etc/ssl/rabbitmq-ca.pem
157
158To manage content of the `cacert_file` use the `cacert` option:
159
160.. code-block:: yaml
161
162 glance:
163 server:
164 ....
165 message_queue:
166 ssl:
167 enabled: True
168 cacert: |
169
170 -----BEGIN CERTIFICATE-----
171 ...
172 -----END CERTIFICATE-------
173
174 cacert_file: /etc/openstack/rabbitmq-ca.pem
175
176
177Notice:
178 * The `message_queue.port` is set to **5671** (AMQPS) by default if `ssl.enabled=True`.
179 * 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.
180
181
mnederlofad6d6242017-03-30 15:31:15 +0200182Enable Glance Image Cache:
183
184.. code-block:: yaml
185
186 glance:
187 server:
188 image_cache:
189 enabled: true
190 enable_management: true
191 directory: /var/lib/glance/image-cache/
192 max_size: 21474836480
193 ....
194
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100195Enable auditing filter (CADF):
196
197.. code-block:: yaml
198
199 glance:
200 server:
201 audit:
202 enabled: true
203 ....
204 filter_factory: 'keystonemiddleware.audit:filter_factory'
205 map_file: '/etc/pycadf/glance_api_audit_map.conf'
206 ....
207
RobertJansen168e84f92017-03-30 15:45:12 +0200208Swift integration glance
209
210.. code-block:: yaml
211
212 glance:
213 server:
214 enabled: true
215 version: mitaka
216 storage:
217 engine: swift,http
218 swift:
219 store:
220 auth:
221 address: http://keystone.example.com:5000/v2.0
222 version: 2
223 endpoint_type: publicURL
224 container: glance
225 create_container_on_put: true
226 retry_get_count: 5
227 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
228 key: someRandomPassword
229
Michel Nederlof3a867812017-05-15 09:46:11 +0200230Another way, which also supports multiple swift backends, can be configured like this:
231
232.. code-block:: yaml
233
234 glance:
235 server:
236 enabled: true
237 version: mitaka
238 storage:
239 engine: swift,http
240 swift:
241 store:
242 endpoint_type: publicURL
243 container: glance
244 create_container_on_put: true
245 retry_get_count: 5
246 references:
247 my_objectstore_reference_1:
248 auth:
249 address: http://keystone.example.com:5000/v2.0
250 version: 2
251 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
252 key: someRandomPassword
253
Ondrej Smolae695fe82017-04-28 12:22:28 +0200254Enable CORS parameters
255
256.. code-block:: yaml
257
258 glance:
259 server:
260 cors:
261 allowed_origin: https:localhost.local,http:localhost.local
262 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
263 allow_methods: GET,PUT,POST,DELETE,PATCH
264 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
265 allow_credentials: True
266 max_age: 86400
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100267
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200268Enable Viewing Multiple Locations
269---------------------------------
270If you want to expose all locations available (for example when you have
271multiple backends configured), then you can configure this like so:
272
273.. code-block:: yaml
274
275 glance:
276 server:
277 show_multiple_locations: True
278 location_strategy: store_type
279 store_type_preference: rbd,swift,file
280
281Please note: the show_multiple_locations option is deprecated since Newton and is planned
282 to be handled by policy files _only_ starting with the Pike release.
283
284This feature is convenient in a scenario when you have swift and rbd configured and want to
285benefit from rbd enhancements.
286
287
Richard Felkl4143a0e2017-02-01 23:24:13 +0100288Client role
289-----------
290
291Glance images
292
293.. code-block:: yaml
294
295 glance:
296 client:
297 enabled: true
298 server:
299 profile_admin:
300 image:
301 cirros-test:
302 visibility: public
303 protected: false
304 location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200305
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100306
307Usage
308=====
309
310Import new public image
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200311
312.. code-block:: yaml
313
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100314 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 +0200315
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100316Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100317
318.. code-block:: yaml
319
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100320 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100321
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100322Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100323
324.. code-block:: yaml
325
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100326 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100327
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200328
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100329External links
330==============
Filip Pytlound681ae22015-10-06 16:28:31 +0200331
332* http://ceph.com/docs/master/rbd/rbd-openstack/
333
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100334
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200335Documentation and Bugs
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100336======================
Filip Pytlound681ae22015-10-06 16:28:31 +0200337
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200338To learn how to deploy OpenStack Salt, consult the documentation available
339online at:
340
341 https://wiki.openstack.org/wiki/OpenStackSalt
342
343In the unfortunate event that bugs are discovered, they should be reported to
344the appropriate bug tracker. If you obtained the software from a 3rd party
345operating system vendor, it is often wise to use their own bug tracker for
346reporting problems. In all other cases use the master OpenStack bug tracker,
347available at:
348
349 http://bugs.launchpad.net/openstack-salt
350
351Developers wishing to work on the OpenStack Salt project should always base
352their work on the latest formulas code, available from the master GIT
353repository at:
354
355 https://git.openstack.org/cgit/openstack/salt-formula-glance
356
357Developers should also join the discussion on the IRC list, at:
358
359 https://wiki.openstack.org/wiki/Meetings/openstack-salt
Filip Pytloune94a0a72017-02-02 13:02:03 +0100360
361Documentation and Bugs
362======================
363
364To learn how to install and update salt-formulas, consult the documentation
365available online at:
366
367 http://salt-formulas.readthedocs.io/
368
369In the unfortunate event that bugs are discovered, they should be reported to
370the appropriate issue tracker. Use Github issue tracker for specific salt
371formula:
372
373 https://github.com/salt-formulas/salt-formula-glance/issues
374
375For feature requests, bug reports or blueprints affecting entire ecosystem,
376use Launchpad salt-formulas project:
377
378 https://launchpad.net/salt-formulas
379
380You can also join salt-formulas-users team and subscribe to mailing list:
381
382 https://launchpad.net/~salt-formulas-users
383
384Developers wishing to work on the salt-formulas projects should always base
385their work on master branch and submit pull request against specific formula.
386
387 https://github.com/salt-formulas/salt-formula-glance
388
389Any questions or feedback is always welcome so feel free to join our IRC
390channel:
391
392 #salt-formulas @ irc.freenode.net